JSTL Form Parameters : Form Action « JSTL « Java Tutorial






<html>
  <head>
  </head>

  <body>
    <form method="POST" action="form2.jsp">
      <table border="1" cellpadding="0" cellspacing="0"
      style="border-collapse: collapse" bordercolor="#111111"
      width="42%" id="AutoNumber1">
        <tr>
          <td width="100%" colspan="2" bgcolor="#0000FF">
            <p align="center">
              <b>
                <font size="4" color="#FFFFFF">Please Login</font>
              </b>
            </p>
          </td>
        </tr>

        <tr>
          <td width="19%">User Name</td>

          <td width="81%">
            <input type="text" name="uid" size="20" />
          </td>
        </tr>

        <tr>
          <td width="19%">Password</td>

          <td width="81%">
            <input type="password" name="pwd" size="20" />
          </td>
        </tr>

        <tr>
          <td width="100%" colspan="2">
            <p align="center">
              <input type="submit" value="Submit" name="action" />

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

    <p align="left">
      <i>Note: you may use any ID/Password, security is not
      checked.</i>
    </p>
  </body>
</html>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
  <h3>Welcome back 
  <c:out value="${param.uid}" />

  !</h3>
</html>
  Download:  JSTLFormParameter.zip( 5,530 k)








24.18.Form Action
24.18.1.Post to the Same Page
24.18.2.Link to Self With Parameter Passing
24.18.3.JSTL Form Parameters
24.18.4.Use Form Parameter as Request Parameters in JSTL