Grosse MàJ

This commit is contained in:
olivier
2008-11-25 22:11:16 +01:00
parent 53195fdfcd
commit 3e719157ea
2980 changed files with 343846 additions and 0 deletions

View File

@ -0,0 +1,45 @@
<html><body><pre>
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jsp2.examples.el;
/**
* Defines the functions for the jsp2 example tag library.
*
* &lt;p>Each function is defined as a static method.&lt;/p>
*/
public class Functions {
public static String reverse( String text ) {
return new StringBuffer( text ).reverse().toString();
}
public static int numVowels( String text ) {
String vowels = "aeiouAEIOU";
int result = 0;
for( int i = 0; i &lt; text.length(); i++ ) {
if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
result++;
}
}
return result;
}
public static String caps( String text ) {
return text.toUpperCase();
}
}
</pre></body></html>

View File

@ -0,0 +1,30 @@
<html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>View Source Code</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p><font color="#0000FF"><a href="basic-arithmetic.jsp"><img src="../../images/execute.gif" align="right" border="0"></a><a href="../../index.html"><img src="../../images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>
<h3><a href="basic-arithmetic.jsp.html">Source Code for Basic Arithmetic Example<font color="#0000FF"></a>
</font> </h3>
</body>
</html>

View File

@ -0,0 +1,88 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<title>JSP 2.0 Expression Language - Basic Arithmetic</title>
</head>
<body>
<h1>JSP 2.0 Expression Language - Basic Arithmetic</h1>
<hr>
This example illustrates basic Expression Language arithmetic.
Addition (+), subtraction (-), multiplication (*), division (/ or div),
and modulus (% or mod) are all supported. Error conditions, like
division by zero, are handled gracefully.
<br>
<blockquote>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>\${1}</td>
<td>${1}</td>
</tr>
<tr>
<td>\${1 + 2}</td>
<td>${1 + 2}</td>
</tr>
<tr>
<td>\${1.2 + 2.3}</td>
<td>${1.2 + 2.3}</td>
</tr>
<tr>
<td>\${1.2E4 + 1.4}</td>
<td>${1.2E4 + 1.4}</td>
</tr>
<tr>
<td>\${-4 - 2}</td>
<td>${-4 - 2}</td>
</tr>
<tr>
<td>\${21 * 2}</td>
<td>${21 * 2}</td>
</tr>
<tr>
<td>\${3/4}</td>
<td>${3/4}</td>
</tr>
<tr>
<td>\${3 div 4}</td>
<td>${3 div 4}</td>
</tr>
<tr>
<td>\${3/0}</td>
<td>${3/0}</td>
</tr>
<tr>
<td>\${10%4}</td>
<td>${10%4}</td>
</tr>
<tr>
<td>\${10 mod 4}</td>
<td>${10 mod 4}</td>
</tr>
<tr>
<td>\${(1==2) ? 3 : 4}</td>
<td>${(1==2) ? 3 : 4}</td>
</tr>
</table>
</code>
</blockquote>
</body>
</html>

View File

@ -0,0 +1,90 @@
<html><body><pre>
&lt;!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
&lt;html>
&lt;head>
&lt;title>JSP 2.0 Expression Language - Basic Arithmetic&lt;/title>
&lt;/head>
&lt;body>
&lt;h1>JSP 2.0 Expression Language - Basic Arithmetic&lt;/h1>
&lt;hr>
This example illustrates basic Expression Language arithmetic.
Addition (+), subtraction (-), multiplication (*), division (/ or div),
and modulus (% or mod) are all supported. Error conditions, like
division by zero, are handled gracefully.
&lt;br>
&lt;blockquote>
&lt;code>
&lt;table border="1">
&lt;thead>
&lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
&lt;td>&lt;b>Result&lt;/b>&lt;/td>
&lt;/thead>
&lt;tr>
&lt;td>\${1}&lt;/td>
&lt;td>${1}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1 + 2}&lt;/td>
&lt;td>${1 + 2}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1.2 + 2.3}&lt;/td>
&lt;td>${1.2 + 2.3}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1.2E4 + 1.4}&lt;/td>
&lt;td>${1.2E4 + 1.4}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${-4 - 2}&lt;/td>
&lt;td>${-4 - 2}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${21 * 2}&lt;/td>
&lt;td>${21 * 2}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${3/4}&lt;/td>
&lt;td>${3/4}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${3 div 4}&lt;/td>
&lt;td>${3 div 4}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${3/0}&lt;/td>
&lt;td>${3/0}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${10%4}&lt;/td>
&lt;td>${10%4}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${10 mod 4}&lt;/td>
&lt;td>${10 mod 4}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${(1==2) ? 3 : 4}&lt;/td>
&lt;td>${(1==2) ? 3 : 4}&lt;/td>
&lt;/tr>
&lt;/table>
&lt;/code>
&lt;/blockquote>
&lt;/body>
&lt;/html>
</pre></body></html>

View File

@ -0,0 +1,30 @@
<html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>View Source Code</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p><font color="#0000FF"><a href="basic-comparisons.jsp"><img src="../../images/execute.gif" align="right" border="0"></a><a href="../../index.html"><img src="../../images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>
<h3><a href="basic-comparisons.jsp.html">Source Code for Basic Comparisons Example<font color="#0000FF"></a>
</font> </h3>
</body>
</html>

View File

@ -0,0 +1,116 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<title>JSP 2.0 Expression Language - Basic Comparisons</title>
</head>
<body>
<h1>JSP 2.0 Expression Language - Basic Comparisons</h1>
<hr>
This example illustrates basic Expression Language comparisons.
The following comparison operators are supported:
<ul>
<li>Less-than (&lt; or lt)</li>
<li>Greater-than (&gt; or gt)</li>
<li>Less-than-or-equal (&lt;= or le)</li>
<li>Greater-than-or-equal (&gt;= or ge)</li>
<li>Equal (== or eq)</li>
<li>Not Equal (!= or ne)</li>
</ul>
<blockquote>
<u><b>Numeric</b></u>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>\${1 &lt; 2}</td>
<td>${1 < 2}</td>
</tr>
<tr>
<td>\${1 lt 2}</td>
<td>${1 lt 2}</td>
</tr>
<tr>
<td>\${1 &gt; (4/2)}</td>
<td>${1 > (4/2)}</td>
</tr>
<tr>
<td>\${1 &gt; (4/2)}</td>
<td>${1 > (4/2)}</td>
</tr>
<tr>
<td>\${4.0 &gt;= 3}</td>
<td>${4.0 >= 3}</td>
</tr>
<tr>
<td>\${4.0 ge 3}</td>
<td>${4.0 ge 3}</td>
</tr>
<tr>
<td>\${4 &lt;= 3}</td>
<td>${4 <= 3}</td>
</tr>
<tr>
<td>\${4 le 3}</td>
<td>${4 le 3}</td>
</tr>
<tr>
<td>\${100.0 == 100}</td>
<td>${100.0 == 100}</td>
</tr>
<tr>
<td>\${100.0 eq 100}</td>
<td>${100.0 eq 100}</td>
</tr>
<tr>
<td>\${(10*10) != 100}</td>
<td>${(10*10) != 100}</td>
</tr>
<tr>
<td>\${(10*10) ne 100}</td>
<td>${(10*10) ne 100}</td>
</tr>
</table>
</code>
<br>
<u><b>Alphabetic</b></u>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>\${'a' &lt; 'b'}</td>
<td>${'a' < 'b'}</td>
</tr>
<tr>
<td>\${'hip' &gt; 'hit'}</td>
<td>${'hip' > 'hit'}</td>
</tr>
<tr>
<td>\${'4' &gt; 3}</td>
<td>${'4' > 3}</td>
</tr>
</table>
</code>
</blockquote>
</body>
</html>

View File

@ -0,0 +1,118 @@
<html><body><pre>
&lt;!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
&lt;html>
&lt;head>
&lt;title>JSP 2.0 Expression Language - Basic Comparisons&lt;/title>
&lt;/head>
&lt;body>
&lt;h1>JSP 2.0 Expression Language - Basic Comparisons&lt;/h1>
&lt;hr>
This example illustrates basic Expression Language comparisons.
The following comparison operators are supported:
&lt;ul>
&lt;li>Less-than (&amp;lt; or lt)&lt;/li>
&lt;li>Greater-than (&amp;gt; or gt)&lt;/li>
&lt;li>Less-than-or-equal (&amp;lt;= or le)&lt;/li>
&lt;li>Greater-than-or-equal (&amp;gt;= or ge)&lt;/li>
&lt;li>Equal (== or eq)&lt;/li>
&lt;li>Not Equal (!= or ne)&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;u>&lt;b>Numeric&lt;/b>&lt;/u>
&lt;code>
&lt;table border="1">
&lt;thead>
&lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
&lt;td>&lt;b>Result&lt;/b>&lt;/td>
&lt;/thead>
&lt;tr>
&lt;td>\${1 &amp;lt; 2}&lt;/td>
&lt;td>${1 &lt; 2}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1 lt 2}&lt;/td>
&lt;td>${1 lt 2}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1 &amp;gt; (4/2)}&lt;/td>
&lt;td>${1 > (4/2)}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1 &amp;gt; (4/2)}&lt;/td>
&lt;td>${1 > (4/2)}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${4.0 &amp;gt;= 3}&lt;/td>
&lt;td>${4.0 >= 3}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${4.0 ge 3}&lt;/td>
&lt;td>${4.0 ge 3}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${4 &amp;lt;= 3}&lt;/td>
&lt;td>${4 &lt;= 3}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${4 le 3}&lt;/td>
&lt;td>${4 le 3}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${100.0 == 100}&lt;/td>
&lt;td>${100.0 == 100}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${100.0 eq 100}&lt;/td>
&lt;td>${100.0 eq 100}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${(10*10) != 100}&lt;/td>
&lt;td>${(10*10) != 100}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${(10*10) ne 100}&lt;/td>
&lt;td>${(10*10) ne 100}&lt;/td>
&lt;/tr>
&lt;/table>
&lt;/code>
&lt;br>
&lt;u>&lt;b>Alphabetic&lt;/b>&lt;/u>
&lt;code>
&lt;table border="1">
&lt;thead>
&lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
&lt;td>&lt;b>Result&lt;/b>&lt;/td>
&lt;/thead>
&lt;tr>
&lt;td>\${'a' &amp;lt; 'b'}&lt;/td>
&lt;td>${'a' &lt; 'b'}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${'hip' &amp;gt; 'hit'}&lt;/td>
&lt;td>${'hip' > 'hit'}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${'4' &amp;gt; 3}&lt;/td>
&lt;td>${'4' > 3}&lt;/td>
&lt;/tr>
&lt;/table>
&lt;/code>
&lt;/blockquote>
&lt;/body>
&lt;/html>
</pre></body></html>

View File

@ -0,0 +1,32 @@
<html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>View Source Code</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p><font color="#0000FF"><a href="functions.jsp?foo=JSP+2.0"><img src="../../images/execute.gif" align="right" border="0"></a><a href="../../index.html"><img src="../../images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>
<h3><a href="functions.jsp.html">Source Code for functions.jsp<font color="#0000FF"></a>
</font> </h3>
<h3><a href="Functions.java.html">Source Code for Functions.java<font color="#0000FF"></a>
</font> </h3>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="my" uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib"%>
<html>
<head>
<title>JSP 2.0 Expression Language - Functions</title>
</head>
<body>
<h1>JSP 2.0 Expression Language - Functions</h1>
<hr>
An upgrade from the JSTL expression language, the JSP 2.0 EL also
allows for simple function invocation. Functions are defined
by tag libraries and are implemented by a Java programmer as
static methods.
<blockquote>
<u><b>Change Parameter</b></u>
<form action="functions.jsp" method="GET">
foo = <input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
<input type="submit">
</form>
<br>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>\${param["foo"]}</td>
<td>${fn:escapeXml(param["foo"])}&nbsp;</td>
</tr>
<tr>
<td>\${my:reverse(param["foo"])}</td>
<td>${my:reverse(fn:escapeXml(param["foo"]))}&nbsp;</td>
</tr>
<tr>
<td>\${my:reverse(my:reverse(param["foo"]))}</td>
<td>${my:reverse(my:reverse(fn:escapeXml(param["foo"])))}&nbsp;</td>
</tr>
<tr>
<td>\${my:countVowels(param["foo"])}</td>
<td>${my:countVowels(fn:escapeXml(param["foo"]))}&nbsp;</td>
</tr>
</table>
</code>
</blockquote>
</body>
</html>

View File

@ -0,0 +1,68 @@
<html><body><pre>
&lt;!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
&lt;%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
&lt;%@ taglib prefix="my" uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib"%>
&lt;html>
&lt;head>
&lt;title>JSP 2.0 Expression Language - Functions&lt;/title>
&lt;/head>
&lt;body>
&lt;h1>JSP 2.0 Expression Language - Functions&lt;/h1>
&lt;hr>
An upgrade from the JSTL expression language, the JSP 2.0 EL also
allows for simple function invocation. Functions are defined
by tag libraries and are implemented by a Java programmer as
static methods.
&lt;blockquote>
&lt;u>&lt;b>Change Parameter&lt;/b>&lt;/u>
&lt;form action="functions.jsp" method="GET">
foo = &lt;input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
&lt;input type="submit">
&lt;/form>
&lt;br>
&lt;code>
&lt;table border="1">
&lt;thead>
&lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
&lt;td>&lt;b>Result&lt;/b>&lt;/td>
&lt;/thead>
&lt;tr>
&lt;td>\${param["foo"]}&lt;/td>
&lt;td>${fn:escapeXml(param["foo"])}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${my:reverse(param["foo"])}&lt;/td>
&lt;td>${my:reverse(fn:escapeXml(param["foo"]))}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${my:reverse(my:reverse(param["foo"]))}&lt;/td>
&lt;td>${my:reverse(my:reverse(fn:escapeXml(param["foo"])))}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${my:countVowels(param["foo"])}&lt;/td>
&lt;td>${my:countVowels(fn:escapeXml(param["foo"]))}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;/table>
&lt;/code>
&lt;/blockquote>
&lt;/body>
&lt;/html>
</pre></body></html>

View File

@ -0,0 +1,31 @@
<html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>View Source Code</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p><font color="#0000FF"><a href="implicit-objects.jsp?foo=bar"><img src="../../images/execute.gif" align="right" border="0"></a><a href="../../index.html">
<img src="../../images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>
<h3><a href="implicit-objects.jsp.html">Source Code for Implicit Objects Example<font color="#0000FF"></a>
</font> </h3>
</body>
</html>

View File

@ -0,0 +1,89 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<title>JSP 2.0 Expression Language - Implicit Objects</title>
</head>
<body>
<h1>JSP 2.0 Expression Language - Implicit Objects</h1>
<hr>
This example illustrates some of the implicit objects available
in the Expression Lanaguage. The following implicit objects are
available (not all illustrated here):
<ul>
<li>pageContext - the PageContext object</li>
<li>pageScope - a Map that maps page-scoped attribute names to
their values</li>
<li>requestScope - a Map that maps request-scoped attribute names
to their values</li>
<li>sessionScope - a Map that maps session-scoped attribute names
to their values</li>
<li>applicationScope - a Map that maps application-scoped attribute
names to their values</li>
<li>param - a Map that maps parameter names to a single String
parameter value</li>
<li>paramValues - a Map that maps parameter names to a String[] of
all values for that parameter</li>
<li>header - a Map that maps header names to a single String
header value</li>
<li>headerValues - a Map that maps header names to a String[] of
all values for that header</li>
<li>initParam - a Map that maps context initialization parameter
names to their String parameter value</li>
<li>cookie - a Map that maps cookie names to a single Cookie object.</li>
</ul>
<blockquote>
<u><b>Change Parameter</b></u>
<form action="implicit-objects.jsp" method="GET">
foo = <input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
<input type="submit">
</form>
<br>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>\${param.foo}</td>
<td>${fn:escapeXml(param["foo"])}&nbsp;</td>
</tr>
<tr>
<td>\${param["foo"]}</td>
<td>${fn:escapeXml(param["foo"])}&nbsp;</td>
</tr>
<tr>
<td>\${header["host"]}</td>
<td>${fn:escapeXml(header["host"])}&nbsp;</td>
</tr>
<tr>
<td>\${header["accept"]}</td>
<td>${fn:escapeXml(header["accept"])}&nbsp;</td>
</tr>
<tr>
<td>\${header["user-agent"]}</td>
<td>${fn:escapeXml(header["user-agent"])}&nbsp;</td>
</tr>
</table>
</code>
</blockquote>
</body>
</html>

View File

@ -0,0 +1,91 @@
<html><body><pre>
&lt;!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
&lt;%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
&lt;html>
&lt;head>
&lt;title>JSP 2.0 Expression Language - Implicit Objects&lt;/title>
&lt;/head>
&lt;body>
&lt;h1>JSP 2.0 Expression Language - Implicit Objects&lt;/h1>
&lt;hr>
This example illustrates some of the implicit objects available
in the Expression Lanaguage. The following implicit objects are
available (not all illustrated here):
&lt;ul>
&lt;li>pageContext - the PageContext object&lt;/li>
&lt;li>pageScope - a Map that maps page-scoped attribute names to
their values&lt;/li>
&lt;li>requestScope - a Map that maps request-scoped attribute names
to their values&lt;/li>
&lt;li>sessionScope - a Map that maps session-scoped attribute names
to their values&lt;/li>
&lt;li>applicationScope - a Map that maps application-scoped attribute
names to their values&lt;/li>
&lt;li>param - a Map that maps parameter names to a single String
parameter value&lt;/li>
&lt;li>paramValues - a Map that maps parameter names to a String[] of
all values for that parameter&lt;/li>
&lt;li>header - a Map that maps header names to a single String
header value&lt;/li>
&lt;li>headerValues - a Map that maps header names to a String[] of
all values for that header&lt;/li>
&lt;li>initParam - a Map that maps context initialization parameter
names to their String parameter value&lt;/li>
&lt;li>cookie - a Map that maps cookie names to a single Cookie object.&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;u>&lt;b>Change Parameter&lt;/b>&lt;/u>
&lt;form action="implicit-objects.jsp" method="GET">
foo = &lt;input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
&lt;input type="submit">
&lt;/form>
&lt;br>
&lt;code>
&lt;table border="1">
&lt;thead>
&lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
&lt;td>&lt;b>Result&lt;/b>&lt;/td>
&lt;/thead>
&lt;tr>
&lt;td>\${param.foo}&lt;/td>
&lt;td>${fn:escapeXml(param["foo"])}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${param["foo"]}&lt;/td>
&lt;td>${fn:escapeXml(param["foo"])}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${header["host"]}&lt;/td>
&lt;td>${fn:escapeXml(header["host"])}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${header["accept"]}&lt;/td>
&lt;td>${fn:escapeXml(header["accept"])}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${header["user-agent"]}&lt;/td>
&lt;td>${fn:escapeXml(header["user-agent"])}&amp;nbsp;&lt;/td>
&lt;/tr>
&lt;/table>
&lt;/code>
&lt;/blockquote>
&lt;/body>
&lt;/html>
</pre></body></html>