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
- Is it possible to logout Primavera P6 through SQL Query? - February 16, 2018
- How to Create Primavera P6 EPPM Database schemas in Microsoft SQL Server - February 15, 2018
- Configure Windows Firewall for Microsoft SQL Server 2017 – Part 4 - February 14, 2018