java left logo
java middle logo
java right logo
 

Home arrow Java EE Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 3942
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
Building a simple form E-mail
User Rating: / 38
PoorBest 

Handling HTML forms is one of the most common tasks when you develop web applications. The JSF provides JSP tags for rendering HTML forms, manages the state of the forms, validates user-input reporting errors, lets you bind user interface components to JavaBean properties, and does many other things that increase your productivity.

JSF also has a rich API that you can use to build custom user interface (UI) components, custom validation classes (validators), and server-side event listeners. JSF contains two tag libraries called JSF Core and HTML Basic. The latter contains JSP tags that render HTML UI components such as buttons, text fields, checkboxes, lists, etc. In our example we use some of these tags to build the form.

The standard prefixes of these two tag libraries are f and h:

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<html>
<head>
<title>Edit</title>
</head>
<body>

<f:use_faces>
    <h:form formName="sampleForm">

////////////// here we bind managed bean to text-area input:

     <h:input_textarea id="text" valueRef="sampleBean.text" rows="3" cols="30">
       <f:validate_required/>
     </h:input_textarea>
     
     <br><h:output_errors for="text"/>

     <p><h:output_text value="This is a Label"/></p>
     ..........
    </h:form>
</f:use_faces>

</body>
</html>


 Related Tips

 
< Prev

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.