Results 1 to 2 of 2
  1. #1
    JohnPringle83 is offline Member
    Join Date
    May 2011
    Posts
    64
    Rep Power
    0

    Default <h:inputText> problem

    Hello,

    I am new to programming with Java EE. I am having problem bulding a simple registration form. The labels for the text boxes are showing when I run the project from my netbeans IDE, but the textboxes themselves are not showing. I followed a tutorial on how to build a simple form with JSF and it works in the tutorial example and I copied the structure of the code and customised it for my own use. Can anyone see where my problem is?

    XML Code:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core">
        <h:head>
            <title>Title</title>
        </h:head>
        <h:body>
           <h1><center>This is the registration page</center></h1>
    
           <center><a href="home.xhtml">Home</a></center>
    
           <h:form>
               <h3>
                   Title: &nbsp;               
                   <h:inputText
                       id="title"
                       value="#{customer.title}">
                   </h:inputText>
                   <br/>
                   First Name: &nbsp;
                   <h:inputText
                       id="firstName"
                       value="#{customer.firstName}">
                   </h:inputText>
                   <br/>
                   Last Name: &nbsp;
                   <h:inputText
                       id="lastName"
                       value="#{customer.lastName}">
                   </h:inputText>
                   <br/>
                   Email: &nbsp;
                   <h:inputText
                       id="email"
                       value="#{customer.email}">
                   </h:inputText>
                   <br/>
                   Username: &nbsp;
                   <h:inputText
                       id="username"
                       value="#{customer.username}">
                   </h:inputText>
                   <br/>
                   Password: &nbsp;
                   <h:inputSecret
                       id="password"
                       value="#{customer.password}">
                       <f:validateLength minimum="8"
                                         maximum="32"/>
                   </h:inputSecret>
                   <br/>
                   <h:selectBooleanCheckbox
                       id="terms"
                       value="#{customer.terms}">
                   </h:selectBooleanCheckbox>
                   I accept the terms and conditions
                   <br/>
                   <h:commandButton
                       id="submit"
                       value="Submit"
                       action="processRegistration.xhtml"/>
               </h3>
           </h:form>
        </h:body>
    </html>

  2. #2
    HALO is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default Re: <h:inputText> problem

    No error in the code.Usually,this can happen when the FacesServlet is not been invoked.Check your web.xml

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •