Use ForEach to List All Form Parameters : Form Input « JSTL « Java Tutorial


    <title>Set page parameters</title>
    This page allows you to enter information that is sent as request
    parameters to another page. The next page lists them. <P />

    <form action="listPageParameters.jsp" method="get">
        <tr><td>Enter an adjective:</td>
            <td><input type="text" name="adjective" /></td>
        <tr><td>Enter a noun:</td>
            <td><input type="text" name="noun" /></td>
        <tr><td>Enter a color:</td>
            <td><input type="text" name="color" /></td>
      <input type="submit" value="Send parameters" />


<%@ taglib prefix="c" uri="" %>

    <title>List page parameters</title>
    You entered the following parameters:<br />
      <%-- 'param' is an implicit object. It is a Map that maps a 'key'
           (the parameter name) to a 'value' --%>
      <c:forEach var="pageParameter" items="${param}">
        <li> <c:out value="${pageParameter.key}" /> = <c:out value="${pageParameter.value}" />
  Download: 1,022 k)

24.15.Form Input
24.15.1.Use ForEach to List All Form Parameters
24.15.2.Set Parameter Value
24.15.3.Get Date value from Form
24.15.4.Parse input from Form
24.15.5.JSTL Form Error Check and Forward
24.15.6.Use JSTL to Create URL From Form Input
24.15.7.Check Parameter Value and Output Error Message