Struts HTML Tags

Struts provides HTML tag library for easy creation of user interfaces.

Ads

Tutorials   
Struts 2.5.10.1 General Availability - released Login form in Struts2 version 2.3.16 Struts 2 Login Application Struts 2 version 2.3.16.3 released Struts 2 version 2.3.15.3 released Struts 2 Hello World Annotation Example Struts Roseindia Struts 2 Tutorial: Easy steps to learn Struts 2 Difference between Struts and Spring Apache Struts 2.3.15.2 launched to fix vulnerable Feature Struts2 Application in Eclipse: Running the application in Eclipse IDE Struts 2 Hello World Application using Eclipse Interceptors in Struts 2 Struts 2 Action Tag Struts 2 in Agile Development Environment Struts 2 UI Tags Generic Tags Creating own Interceptor What are Interceptors in Struts 2 and how do they work? Results Value Stack / OGNL Action in Struts 2 Framework Struts 2 Interceptors Struts 2.3.15.1 Maven - How to use Maven dependency of Struts 2.3.15.1? Download Struts 2.3.15.1 How Struts 2 Framework works? Architecture of Struts 2 Framework Features and Enhancements in Struts 2.3.15.1 Struts 2 Tutorials - Struts version 2.3.15.1 Struts 1 Tutorial and example programs Struts Tutorial What is Struts Struts Flow Diagram Step By Step Struts Tutorial Struts 2 Login Form Example Struts Video Tutorials Struts 2 Hello World Example Introduction to Struts 2 Framework Downloading and Installing Struts 2.3.8 In Struts What is Model? What is Struts? Download Struts What is Struts Framework? Struts Framework Latest Version of Struts Framework Downloading Struts Official example Struts 2.3.8 released with new features Struts 2.3.8 Tutorials and Examples Hibernate4 Struts Integration Struts2 Tiles Example
Ads

Struts HTML Tags

     

Struts provides HTML tag library for easy creation of user interfaces. In this lesson I will show you what all Struts HTML Tags are available to the JSP for the development of user interfaces.

To use the Struts HTML Tags we have to include the following line in our JSP file:

<%@ taglib uri="/tags/struts-html" prefix="html" %>

above code makes available the tag to the jsp.

 

Struts HTML Tags
<html:message key="thekey"/> Looks up the message corresponding to the given key in the message resources and displays it.
<html:password property="prop" size="10"/> Tag creates the password field. The string is stored in the property named prop in the form bean.
<html:text property="text1" size="5"/> Tag creates the text field. The string is retrieved from and later stored in the property named text1 in the form bean.
<html:submit>Submit</html:submit> Tag creates a submit button with the provided content as the button text. 
<html:reset>Reset</html:reset> Tag creates a reset button with the provided content as the button text. 
<html:errors/> Tag prints all the available error on the page.
<html:file property="fileSelectionBox"/> Tag creates the file upload element on the form. The property must be of the type org.apache.struts.upload.FormFile.
<html:checkbox property="myCheckBox"/> Tag creates check box on the form.
<html:hidden property="hiddenfield"/> Tag creates the hidden html element on the form.
<html:radio value="abc" property="myCheckBox"/> Tag creates the check box on the form.
<html:select multiple="true" property="selectBox"> Tag creates list box on the form. The property selectBox must be an array of supported data-types, and the user may select several entries. Use <html:options> to specify the entries.
<html:textarea property="myTextArea" value="Hello Struts" /> Tag creates the text area on the form.
<html:form action="/Address" method="post"> Tag is used to create the HTML Form for posting the data on the server.
<html:base/> Tag generates the base tag. <BASE ...> tells the browser to pretend that the current page is located at some URL other than where the browser found it. Any relative reference will be calculated from the URL given by <BASE HREF="..."> instead of the actual URL. <BASE ...> goes in the <HEAD> section.
<html:html> Tag renders an HTML <html> Element.

In the Address.jsp we have used some of the above tags. In the future sections I will show you more examples of the Struts HTML tags.

 

     

Advertisements

Ads
Share on Google+Share on Google+

Struts HTML Tags

Posted on: February 12, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: Struts HTML Tags   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
koteswararao
January 6, 2012
using include jsp's in struts

i have using include jsp's in struts i want code

Ads

 

Ads