Struts HTML Tags (I)

17 January 2008

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.

<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.

Follow the other part of this post.

del.icio.us:Struts HTML Tags (I)  digg:Struts HTML Tags (I)  spurl:Struts HTML Tags (I)  wists:Struts HTML Tags (I)  simpy:Struts HTML Tags (I)  newsvine:Struts HTML Tags (I)  blinklist:Struts HTML Tags (I)  furl:Struts HTML Tags (I)  reddit:Struts HTML Tags (I)  fark:Struts HTML Tags (I)  blogmarks:Struts HTML Tags (I)  Y!:Struts HTML Tags (I)  smarking:Struts HTML Tags (I)  magnolia:Struts HTML Tags (I)  segnalo:Struts HTML Tags (I)  gifttagging:Struts HTML Tags (I)

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Struts HTML Tags (I)

Leave a Reply