Home Spring Spring3.2 The password tag



The password tag
Posted on: January 14, 2013 at 12:00 AM
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=&q




					uot;password" value="^59690krBDc" showPassword="true" /></td>
		</tr>
		<tr>
		<td colspan="2">
		<input type="submit" value="Login" />
		</td>
		</tr>
	</table>
</form:form>


Related Tags for The password tag:


More Tutorials from this section

Ask Questions?    Discuss: The password tag  

Post your Comment


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

Ask Questions?

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.