Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
771 blopes 1
<%--
2
 Licensed to the Apache Software Foundation (ASF) under one or more
3
  contributor license agreements.  See the NOTICE file distributed with
4
  this work for additional information regarding copyright ownership.
5
  The ASF licenses this file to You under the Apache License, Version 2.0
6
  (the "License"); you may not use this file except in compliance with
7
  the License.  You may obtain a copy of the License at
8
 
9
      http://www.apache.org/licenses/LICENSE-2.0
10
 
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
--%>
17
<%@page contentType="text/html; charset=UTF-8" %>
18
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
19
 
20
<html>
21
  <head>
22
    <title>JSP 2.0 Expression Language - Implicit Objects</title>
23
  </head>
24
  <body>
25
    <h1>JSP 2.0 Expression Language - Implicit Objects</h1>
26
    <hr>
27
    This example illustrates some of the implicit objects available
28
    in the Expression Language.  The following implicit objects are
29
    available (not all illustrated here):
30
    <ul>
31
      <li>pageContext - the PageContext object</li>
32
      <li>pageScope - a Map that maps page-scoped attribute names to
33
          their values</li>
34
      <li>requestScope - a Map that maps request-scoped attribute names
35
          to their values</li>
36
      <li>sessionScope - a Map that maps session-scoped attribute names
37
          to their values</li>
38
      <li>applicationScope - a Map that maps application-scoped attribute
39
          names to their values</li>
40
      <li>param - a Map that maps parameter names to a single String
41
          parameter value</li>
42
      <li>paramValues - a Map that maps parameter names to a String[] of
43
          all values for that parameter</li>
44
      <li>header - a Map that maps header names to a single String
45
          header value</li>
46
      <li>headerValues - a Map that maps header names to a String[] of
47
          all values for that header</li>
48
      <li>initParam - a Map that maps context initialization parameter
49
          names to their String parameter value</li>
50
      <li>cookie - a Map that maps cookie names to a single Cookie object.</li>
51
    </ul>
52
 
53
    <blockquote>
54
      <u><b>Change Parameter</b></u>
55
      <form action="implicit-objects.jsp" method="GET">
56
          foo = <input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
57
          <input type="submit">
58
      </form>
59
      <br>
60
      <code>
61
        <table border="1">
62
          <thead>
63
            <td><b>EL Expression</b></td>
64
            <td><b>Result</b></td>
65
          </thead>
66
          <tr>
67
            <td>\${param.foo}</td>
68
            <td>${fn:escapeXml(param["foo"])}&nbsp;</td>
69
          </tr>
70
          <tr>
71
            <td>\${param["foo"]}</td>
72
            <td>${fn:escapeXml(param["foo"])}&nbsp;</td>
73
          </tr>
74
          <tr>
75
            <td>\${header["host"]}</td>
76
            <td>${fn:escapeXml(header["host"])}&nbsp;</td>
77
          </tr>
78
          <tr>
79
            <td>\${header["accept"]}</td>
80
            <td>${fn:escapeXml(header["accept"])}&nbsp;</td>
81
          </tr>
82
          <tr>
83
            <td>\${header["user-agent"]}</td>
84
            <td>${fn:escapeXml(header["user-agent"])}&nbsp;</td>
85
          </tr>
86
        </table>
87
      </code>
88
    </blockquote>
89
  </body>
90
</html>