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:
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.
struts.xml
| <action name="resetTag"> <result>/pages/uiTags/resetTag.jsp</result> </action> |
Create a jsp using the tag <s:reset>.
It renders a reset button which provides the form resetting.
resetTag.jsp
|
<%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <title>Reset Tag Example!</title> <link href="<s:url value="/css/main.css"/>" rel="stylesheet" type="text/css"/> </head> <body> <h1><span style="background-color: #FFFFcc">Reset Tag Example!</span></h1> <s:form> <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" /> </s:form> </body> </html> |
Output of the resetTag.jsp:
![]() |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Reset Tag (Form Tag) Example View All Comments
Post your Comment