Home Spring Spring3.2 The password tag
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

The password tag

Advertisement
In this section, you will learn about the password tag of the Spring form tag library.

The password tag

In this section, you will learn about the password tag of the Spring form tag library.

The form tag provides an HTML 'input' tag with type 'password' using the bound value as given below :

<form:form>
	<table>
		<tr>
		<td>User Name:</td>
		<td><form:input path="userName" /></td>
		</tr>
		<tr>
		<td>Password:</td>
		<td><form:password path="password" /></td>
		</tr>
		<tr>
		<td colspan="2">
		<input type="submit" value="Login" />
		</td>
		</tr>
	</table>
</form:form>

As you can see that the <form: password> tag is used to define the password input field of the form.

By default, the password value is not shown by this tag. If you want to show password value, you can do this by setting the value of the 'showPassword' attribute to true. When you do it, you will get the rendered HTML code as shown below :

<form:form>
	<table>
		<tr>
		<td>User Name:</td>
		<td><form:input path="userName" /></td>
		</tr>
		<tr>
		<td>Password:</td>
		<td><form:password path="password" value="^59690krBDc" showPassword="true" /></td>
		</tr>
		<tr>
		<td colspan="2">
		<input type="submit" value="Login" />
		</td>
		</tr>
	</table>
</form:form>


Advertisement

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: January 14, 2013

Ask Questions?    Discuss: The password tag  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com