| javax.faces.component.UIInput.REQUIRED= Please enter the required value. |
Register the message bundle within <application> tag in
the configuration file (faces-config.xml) and restart the server. Now
when we use message or messages tag in the view page then the value
specified in this message bundle file for a particular error is
displayed.
prompt=Enter Your Name:
|
Now edit the configuration file using <message-bundle> element which tells the application where the message resource file is located.
<application> |
Now, message resource bundle is loaded first using core tag <f:loadBundle> in view page. That loads the bundle and stores it in the request scope.
<f:loadBundle basename="roseindia.messages" var="message"/>
|
We can now use this in our JSP like below :
<h:outputText
value="#{message.prompt}"/>
|
<context-param> |
|
Recommend the tutorial |
Ask Questions? Discuss: JSF Interview Questions
Post your Comment