I am new to JSF and managed beans. I have a managed bean with some private property with public installers and Getter methods. Now that I am adding managed beans to JSF forms, should I directly add private methods or use property calls with the Getter method?
For instance:
<h:inputText value="#{BeanName.userName}"/>
<h:inputText value="#{BeanName.getUserName()}"/>
Which one is true above?
, JBoss EL EL 2.2+, . , get , set . , . EL ( ) getUserName() setUserName(), .
get
set
getUserName()
setUserName()
, JSF EL, .
JSF, - JSF.
java -
.... private String coolStuff; public String getCoolStuff() { return coolStuff; } ....
jsf :
#{myBackingBean.coolStuff}
getCoolStuff()
,
number 1 is correct above, this is a private field that you connect if you use EL with JSF in your form.
You still need the getter and setter that the managed bean calls to get the values so you can store them in the database .... etc
Source: https://habr.com/ru/post/1751635/More articles:selection using LINQ - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1751631/git-status-shows-changes-to-be-commited-but-git-push-origin-master-says-everything-up-to-date&usg=ALkJrhip2OxsCuQ18aPC7p2z-weS_o9BzAreturn var not working when var is huge? - phpHow to use abbreviations in Vim with arguments? - vimCocos2D iPad Создание векторных спрайтов/Spritesheet - objective-cHow can I get the compiler to tell me which file #define value? - c ++How to embed iframe in facebook? - facebookFirefox css table generates kill table width - htmlAllow installation of only a specific class / instance - c #Is there anyone out there using Clear Case with Sybase Powerbuilder? - version-controlAll Articles