Usually this can be done in two ways:
(Let’s assume com.j2eebrainJsf.messages is the properties file)
The easiest way is to include the following elements in faces-config.xml file:
<application> <resource-bundle> <base-name>com.j2eebrainJsf.messages</base-name> <var>message</var> </resource-bundle> </application>
Another way is that you can add the f:loadBundle element to each JSF page that needs access to the bundle:
<f:loadBundle baseName = “com.j2eebrainJsf.messages” var=”message”/>
The main six phases that are part of the JSF application lifecycle are :
1. Restore view
2. Apply request values; process events
3. Process validations; process events
4. Update model values; process events
5. Invoke application; process events
6. Render response
The bean instance is configured in the faces-config.xml file:
<managed-bean> <managed-bean-name>login</managed-bean-name> <managed-bean-class>com.j2eebrainJsf.loginBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean>
This means: Construct an object of the class com.j2eebrainJsf.loginBean, give it the name login, and keep it alive for the duration of the request.
JSF supports three Bean Scopes. these are mainly :
Request Scope: This is for a request and gets died of when the response is sent back to the requestor.
Session Scope: The is for a session and is availanble till the session is ended.
Application Scope: The is for the entire duration of the web application. This scope is shared among Request and Session scopes
In JSF applications the JSP pages are used to represent the views JSF has a mechanism to use special tags to improve the views
For each tag there is a associated component. JSF (Sun Implementation) provides 43 tags in two standard JSF tag libraries: