JSTL: Form Action Text Field

In this example we are going to retrieve the value we have entered in the jsp form.

JSTL: Form Action Text Field

JSTL: Form Action Text Field

        

In this example we are going to retrieve the value we have entered in the jsp form. 

Firstly we are going to make a simple jsp form page in which there are two textfields, one is for user name and the second one is for the password. We will enter the values into it and those values will be retrieved by the controller and the result will be displayed to you by the <c:out> core action tag on your browser. 

The code of the program is given below:

 

 

<html>
<head>
</head>

<body>
<form method="post" action="JSTLFormActionTextFieldProperty.jsp">
<table border="1">
<tr>
<td>
<p align="center">
<b>
Login Page
</b>
</p>
</td>
</tr>

<tr>
<td>Enter Name</td>

<td>
<input type="text" name="name"/>
</td>
</tr>

<tr>
<td>Enter Password</td>

<td>
<input type="password" name="pwd"/>
</td>
</tr>

<tr>
<td>
<p align="center">
<input type="submit" name="submit" />

<input type="reset" name="Reset"/>
</p>
</td>
</tr>
</table>
</form>

</body>
</html>

 

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<h1>Welcome <c:out value="${param.name}"/><br>
And your password is <c:out value="${param.pwd}"/></h1>

</html>

The output of the program is given below:

 

 

Download this example.