Home > error message > error messages in jsf

Error Messages In Jsf

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have jsf custom error messages Meta Discuss the workings and policies of this site About Us

H Messages

Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads

Jsf Addmessage

with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers,

Jsf Validation

just like you, helping each other. Join them; it only takes a minute: Sign up Error messages on page with the in JSF up vote 4 down vote favorite 2 I'm creating simple example on JSF. It's small Login application. My problem is duplicate error messages on my page: I have two h:message(for username and jsf error messages display password) tags and one h:messages(global messages) on my page: Action method login() in my backing bean: public String login() { FacesContext facesContext = FacesContext.getCurrentInstance(); if ("admin".equals(username) && "pass".equals(password)) { return "success"; } else { facesContext.addMessage("loginForm", new FacesMessage("Username or password is incorrect")); return null; } } I want to display message about empty username or password only next to these fields, not under my button in global messages. And I want to print my error message from my action method in global messages if password or username is incorrect. How can I resolve this? I tried to use the attribute globalOnly: