source: nutchez-0.1/tomcat/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html @ 261

Last change on this file since 261 was 66, checked in by waue, 15 years ago

NutchEz - an easy way to nutch

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