JSF Messages Example
The JSF Messages tag displays all the JSF error messages in one place.
The Below JSF page has an h:messages tag which displays all error messages in the page.I have set required=true for all input components so the h:messages display the errors if a user submits the form without filling data in to the input components.
<h:messages layout="table" style="color:red;" /><br/>
Username: <h:inputText id="username" label="username" required="true" style="color:red;" /><br/>
Password: <h:inputText id="password" label="password" required="true" /><br/>
<h:commandButton type="submit" value="Submit"/>
Below is how the h:messages error looks like in the browser on submitting the form.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- How to create a Read-Only-User in Oracle WebLogic server - May 13, 2018
- How to disable Primavera P6 admin config or Application settings from user - May 7, 2018
- How to increase the session timeout in Primavera P6 EPPM - February 28, 2018