• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

managing Faces-config in jSF ...please explain.

 
hanumantha prem
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on jSF and i am using RAD 6,and I have one doubt.This is my faces config file.
<managed-bean>
<description>The one and only HelloBean.</description>
<managed-bean-name>helloBean</managed-bean-name>
<managed-bean-class>com.HelloBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<description>Navigation from the hello page.</description>
<from-view-id>/hello.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/goodbye.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>pc_Myjsp</managed-bean-name>
<managed-bean-class>pagecode.Myjsp</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pc_Hello</managed-bean-name>
<managed-bean-class>pagecode.Hello</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pc_Goodbye</managed-bean-name>
<managed-bean-class>pagecode.Goodbye</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
The managed-bean helloBean is added by me for my application,and the other 2 which are generated by the application itself,i.e they are backing beans.How one can differentiate these files by looking at the faces config file..or is there any way to keep these in different files. or how do you manage in faces config. please reply
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Backing beans are managed beans. A backing bean is a bean that's referenced in a JSF page definition.

A Managed bean is any JavaBean that's managed by the JSF framework. And the way you tell JSF to manage a bean is to define it in either faces-config.xml or a similar file(s) designated by you in your webapp's web.xml file according to JSF's rules for such definitions.
 
hanumantha prem
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i want to keep the entries in different files..what could be done in order to do so.Please explain
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have your JSF application read from separate faces-config files by entering their names in the deployment descriptor:




I've seen big appliations separate managed beans and navigation rules into separate files just to manage them a bit easier.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic