HTML and CSS Reference
In-Depth Information
public void setTitle(String title) {
this.title = title;
public String getIndustry() {
return industry;
public void setIndustry(String industry) {
this.industry = industry;
Associating the Profession managed bean instance with the User managed bean instance can be done using
either the JSF configuration file or the JSF annotations. Listing 2-12 shows the part of the JSF configuration file which
configures the Profession managed bean to be injected in the User managed bean when it is instantiated.
Listing 2-12. Configuring the Profession Instance to Be Injected in the User Instance
< managed - property>
<value>Software Engineer</value>
The Profession managed bean is declared in the none scope in order to have the scope of its caller managed
bean which instantiates it (which is the User managed bean in this case). In the User managed bean, a property
initialization is defined for the profession property, and the #{profession} expression is used as the value for the
profession property using the <managed-property> element.
After doing this configuration, the Profession managed bean will be instantiated and set in the session scope
when the User managed bean is instantiated by the JSF framework. This means that the #{user.profession.title}
expression will return the initial value for the profession title, which is "Software Engineer" .
Search WWH ::

Custom Search