Java class name convention with respect to managed been usage in Primefaces

蓝咒 提交于 2019-12-08 09:04:31

In order to follow the Java standard for class name I have used the following approach.

@ManagedBean(name="myClass")
public class MyClass {

}

previously due to JSF behaviour, I was using

@ManagedBean
public class myClass {

}

Please also share that what you do in such cases.

Thanks,

Asad

Its the expected behavior

By default, the name associated with a bean is simply the lowercase form of its class name

You give your class a name with Capitalized Letter , like MyClass and accessing it from your xhtmls like this #{myClass.someVariable} (with a lower case prefix)

its not related to Primefaces , its the general approach in JSF

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!