Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Struts Struts2 Struts2uitags Reset Tag (Form Tag) Example

Related Tutorials


Share on Google+Share on Google+

Reset Tag (Form Tag) Example

In this section, we are going to describe the reset tag.

Reset Tag (Form Tag) Example


In this section, we are going to describe the reset tag. The reset tag is a UI tag that  is used with the form tag to provide form resetting.
It renders a reset button.
The reset can have two different types of rendering:

  • input: renders as html <input type="reset"...>
  • button: renders as html <button type="reset"...>

The button type has advantages as it adds  the possibility to separate the submitted value from the text shown on the button face.

Add the following code snippet into the struts.xml file.

<action name="resetTag">

Create a jsp using the tag <s:reset>. It renders a reset button which provides the form resetting.


<%taglib prefix="s" uri="/struts-tags" %>
  <title>Reset Tag Example!</title> 
 <link href="<s:url value="/css/main.css"/>" rel="stylesheet"
  <h1><span style="background-color: #FFFFcc">Reset Tag Example!</span></h1>
  <s:textfield name="username" label="User Name" size="15" maxlength="10" />
  <s:password name="password" label="Password" size="15" maxlength="10" />
  <s:reset value="Reset" />

Output of the resetTag.jsp:


If you enjoyed this post then why not add us on Google+? Add us to your Circles

Liked it!  Share this Tutorial

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 28, 2007

Related Tutorials

Discuss: Reset Tag (Form Tag) Example   View All Comments

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image