facebook

[Closed] JSF Login Demo – display the error message

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #247402 Reply

    darrenk
    Member

    Hi,
    I’m having trouble getting the <h:message> or <h:messages> tag to display the error message from a failed login in the JSF Login Demo.

    I saw this post –
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-11051.html

    but I can’t get the correct form of the tag.

    Can you post it here?

    Thanks
    -D

    #247410 Reply

    Riyad Kalla
    Member

    Instead of mangling this with my poor memory, I dug up an example from another online tutorial. NOTE, the example below is from the following tutorial.
    http://www.javaranch.com/newsletter/200404/JSF_Part1.html

    Here is how it looks in action

    
    <f:view> 
      <h:form id="loginForm"> 
        <h:message for="loginForm" /><br /> 
        <h:outputText value="#{Message.username_label}" /> 
        <h:inputText id="username" value="#{LoginBean.username}" required="true"> 
          <f:validateLength maximum="15" minimum="3" /> 
        </h:inputText> 
        <h:message for="username" /><br />
        <h:outputText value="#{Message.password_label}" /> 
        <h:inputSecret id="password" value="#{LoginBean.password}" required="true"> 
          <f:validateLength maximum="15" minimum="3" /> 
        </h:inputSecret> 
        <h:message for="password" /><br />  
        <h:commandButton id="submit" action="#{LoginBean.login}" value="#{Message.login_button}" /> 
      </h:form> 
    </f:view> 
    
    #247420 Reply

    darrenk
    Member

    That it. Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: [Closed] JSF Login Demo – display the error message

You must be logged in to post in the forum log in