Query String : Page Context « JSTL « Java Tutorial






<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
  <head>
    <title>Query String Example</title>
  </head>

  <body>Your favorite color is: 
  <b>
    <c:out value="${param.color}" />
  </b>

  <br />

  <br />

  Choose your favorite color:
  <br />

  <br />

  <a
  href="<c:out value="${pageContext.request.requestURI}"/>?color=red">
  red</a>

  <br />

  <a
  href="<c:out value="${pageContext.request.requestURI}"/>?color=blue">
  blue</a>

  <br />

  <a
  href="<c:out value="${pageContext.request.requestURI}"/>?color=green">
  green</a>

  <br />

  <a
  href="<c:out value="${pageContext.request.requestURI}"/>?color=yellow">
  yellow</a>

  <br />

  <a
  href="<c:out value="${pageContext.request.requestURI}"/>?color=other">
  other</a>

  <br />
  </body>
</html>
  Download:  JSTLQueryString.zip( 5,368 k)








24.26.Page Context
24.26.1.Set Variable to Page Context
24.26.2.Set Class to Page Context
24.26.3.Query String
24.26.4.Check Page Context Request Method