소스 파일 최초 업로드
This commit is contained in:
46
tomcat/webapps.dist/examples/jsp/jsp2/el/Functions.java.html
Normal file
46
tomcat/webapps.dist/examples/jsp/jsp2/el/Functions.java.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Defines the functions for the jsp2 example tag library.
|
||||
*
|
||||
* <p>Each function is defined as a static method.</p>
|
||||
*/
|
||||
public class Functions {
|
||||
public static String reverse( String text ) {
|
||||
return new StringBuilder( text ).reverse().toString();
|
||||
}
|
||||
|
||||
public static int numVowels( String text ) {
|
||||
String vowels = "aeiouAEIOU";
|
||||
int result = 0;
|
||||
for( int i = 0; i < text.length(); i++ ) {
|
||||
if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String caps( String text ) {
|
||||
return text.toUpperCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
</pre></body></html>
|
||||
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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;
|
||||
|
||||
/**
|
||||
* Accept and display a value.
|
||||
*/
|
||||
public class ValuesBean {
|
||||
private String string;
|
||||
private double doubleValue;
|
||||
private long longValue;
|
||||
|
||||
public String getStringValue() {
|
||||
return this.string;
|
||||
}
|
||||
|
||||
public void setStringValue(String string) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
public double getDoubleValue() {
|
||||
return doubleValue;
|
||||
}
|
||||
|
||||
public void setDoubleValue(double doubleValue) {
|
||||
this.doubleValue = doubleValue;
|
||||
}
|
||||
|
||||
public long getLongValue() {
|
||||
return longValue;
|
||||
}
|
||||
|
||||
public void setLongValue(long longValue) {
|
||||
this.longValue = longValue;
|
||||
}
|
||||
}
|
||||
</pre></body></html>
|
||||
80
tomcat/webapps.dist/examples/jsp/jsp2/el/ValuesTag.java.html
Normal file
80
tomcat/webapps.dist/examples/jsp/jsp2/el/ValuesTag.java.html
Normal file
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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 examples;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspTagException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.tagext.TagSupport;
|
||||
|
||||
/**
|
||||
* Accept and display a value.
|
||||
*/
|
||||
public class ValuesTag extends TagSupport {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// Using "-1" as the default value,
|
||||
// in the assumption that it won't be used as the value.
|
||||
// Cannot use null here, because null is an important case
|
||||
// that should be present in the tests.
|
||||
private Object objectValue = "-1";
|
||||
private String stringValue = "-1";
|
||||
private long longValue = -1;
|
||||
private double doubleValue = -1;
|
||||
|
||||
public void setObject(Object objectValue) {
|
||||
this.objectValue = objectValue;
|
||||
}
|
||||
|
||||
public void setString(String stringValue) {
|
||||
this.stringValue = stringValue;
|
||||
}
|
||||
|
||||
public void setLong(long longValue) {
|
||||
this.longValue = longValue;
|
||||
}
|
||||
|
||||
public void setDouble(double doubleValue) {
|
||||
this.doubleValue = doubleValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int doEndTag() throws JspException {
|
||||
JspWriter out = pageContext.getOut();
|
||||
|
||||
try {
|
||||
if (!"-1".equals(objectValue)) {
|
||||
out.print(objectValue);
|
||||
} else if (!"-1".equals(stringValue)) {
|
||||
out.print(stringValue);
|
||||
} else if (longValue != -1) {
|
||||
out.print(longValue);
|
||||
} else if (doubleValue != -1) {
|
||||
out.print(doubleValue);
|
||||
} else {
|
||||
out.print("-1");
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new JspTagException("IOException: " + ex.toString(), ex);
|
||||
}
|
||||
return super.doEndTag();
|
||||
}
|
||||
}
|
||||
</pre></body></html>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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.
|
||||
--%>
|
||||
<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>
|
||||
</pre></body></html>
|
||||
@@ -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>
|
||||
116
tomcat/webapps.dist/examples/jsp/jsp2/el/basic-comparisons.jsp
Normal file
116
tomcat/webapps.dist/examples/jsp/jsp2/el/basic-comparisons.jsp
Normal 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 (< or lt)</li>
|
||||
<li>Greater-than (> or gt)</li>
|
||||
<li>Less-than-or-equal (<= or le)</li>
|
||||
<li>Greater-than-or-equal (>= 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 < 2}</td>
|
||||
<td>${1 < 2}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${1 lt 2}</td>
|
||||
<td>${1 lt 2}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${1 > (4/2)}</td>
|
||||
<td>${1 > (4/2)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${1 gt (4/2)}</td>
|
||||
<td>${1 gt (4/2)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${4.0 >= 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 <= 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' < 'b'}</td>
|
||||
<td>${'a' < 'b'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${'hip' > 'hit'}</td>
|
||||
<td>${'hip' > 'hit'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${'4' > 3}</td>
|
||||
<td>${'4' > 3}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</code>
|
||||
</blockquote>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,117 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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.
|
||||
--%>
|
||||
<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 gt (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>
|
||||
</pre></body></html>
|
||||
31
tomcat/webapps.dist/examples/jsp/jsp2/el/composite.html
Normal file
31
tomcat/webapps.dist/examples/jsp/jsp2/el/composite.html
Normal 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="composite.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="composite.jsp.html">Source Code for composite.jsp</a></h3>
|
||||
<h3><a href="ValuesTag.java.html">Source Code for ValuesTag.java</a></h3>
|
||||
<h3><a href="ValuesBean.java.html">Source Code for ValuesBean.java</a></h3>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
110
tomcat/webapps.dist/examples/jsp/jsp2/el/composite.jsp
Normal file
110
tomcat/webapps.dist/examples/jsp/jsp2/el/composite.jsp
Normal file
@@ -0,0 +1,110 @@
|
||||
<%--
|
||||
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="my" uri="http://tomcat.apache.org/example-taglib" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>JSP 2.0 Expression Language - Composite Expressions</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>JSP 2.0 Expression Language - Composite Expressions</h1>
|
||||
<hr>
|
||||
This example illustrates EL composite expressions. Composite expressions
|
||||
are formed by grouping together multiple EL expressions. Each of them is
|
||||
evaluated from left to right, coerced to String, all those strings are
|
||||
concatenated, and the result is coerced to the expected type.
|
||||
|
||||
<jsp:useBean id="values" class="jsp2.examples.ValuesBean" />
|
||||
|
||||
<blockquote>
|
||||
<code>
|
||||
<table border="1">
|
||||
<thead>
|
||||
<td><b>EL Expression</b></td>
|
||||
<td><b>Type</b></td>
|
||||
<td><b>Result</b></td>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>\${'hello'} wo\${'rld'}</td>
|
||||
<td>String</td>
|
||||
<td><jsp:setProperty name="values" property="stringValue" value="${'hello'} wo${'rld'}"/>${values.stringValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${'hello'} wo\${'rld'}</td>
|
||||
<td>String</td>
|
||||
<td><my:values string="${'hello'} wo${'rld'}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${1+2}.\${220}</td>
|
||||
<td>Double</td>
|
||||
<td><jsp:setProperty name="values" property="doubleValue" value="${1+2}.${220}"/>${values.doubleValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${1+2}.\${220}</td>
|
||||
<td>Double</td>
|
||||
<td><my:values double="${1+2}.${220}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>000\${1}\${7}</td>
|
||||
<td>Long</td>
|
||||
<td><jsp:setProperty name="values" property="longValue" value="000${1}${7}"/>${values.longValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>000\${1}\${7}</td>
|
||||
<td>Long</td>
|
||||
<td><my:values long="000${1}${7}"/></td>
|
||||
</tr>
|
||||
<!--
|
||||
Undefined values are to be coerced to String, to be "",
|
||||
https://bz.apache.org/bugzilla/show_bug.cgi?id=47413
|
||||
-->
|
||||
<tr>
|
||||
<td>\${undefinedFoo}hello world\${undefinedBar}</td>
|
||||
<td>String</td>
|
||||
<td><jsp:setProperty name="values" property="stringValue" value="${undefinedFoo}hello world${undefinedBar}"/>${values.stringValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}hello world\${undefinedBar}</td>
|
||||
<td>String</td>
|
||||
<td><my:values string="${undefinedFoo}hello world${undefinedBar}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Double</td>
|
||||
<td><jsp:setProperty name="values" property="doubleValue" value="${undefinedFoo}${undefinedBar}"/>${values.doubleValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Double</td>
|
||||
<td><my:values double="${undefinedFoo}${undefinedBar}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Long</td>
|
||||
<td><jsp:setProperty name="values" property="longValue" value="${undefinedFoo}${undefinedBar}"/>${values.longValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Long</td>
|
||||
<td><my:values long="${undefinedFoo}${undefinedBar}"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</code>
|
||||
</blockquote>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
111
tomcat/webapps.dist/examples/jsp/jsp2/el/composite.jsp.html
Normal file
111
tomcat/webapps.dist/examples/jsp/jsp2/el/composite.jsp.html
Normal file
@@ -0,0 +1,111 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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.
|
||||
--%>
|
||||
<%@ taglib prefix="my" uri="http://tomcat.apache.org/example-taglib" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>JSP 2.0 Expression Language - Composite Expressions</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>JSP 2.0 Expression Language - Composite Expressions</h1>
|
||||
<hr>
|
||||
This example illustrates EL composite expressions. Composite expressions
|
||||
are formed by grouping together multiple EL expressions. Each of them is
|
||||
evaluated from left to right, coerced to String, all those strings are
|
||||
concatenated, and the result is coerced to the expected type.
|
||||
|
||||
<jsp:useBean id="values" class="jsp2.examples.ValuesBean" />
|
||||
|
||||
<blockquote>
|
||||
<code>
|
||||
<table border="1">
|
||||
<thead>
|
||||
<td><b>EL Expression</b></td>
|
||||
<td><b>Type</b></td>
|
||||
<td><b>Result</b></td>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>\${'hello'} wo\${'rld'}</td>
|
||||
<td>String</td>
|
||||
<td><jsp:setProperty name="values" property="stringValue" value="${'hello'} wo${'rld'}"/>${values.stringValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${'hello'} wo\${'rld'}</td>
|
||||
<td>String</td>
|
||||
<td><my:values string="${'hello'} wo${'rld'}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${1+2}.\${220}</td>
|
||||
<td>Double</td>
|
||||
<td><jsp:setProperty name="values" property="doubleValue" value="${1+2}.${220}"/>${values.doubleValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${1+2}.\${220}</td>
|
||||
<td>Double</td>
|
||||
<td><my:values double="${1+2}.${220}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>000\${1}\${7}</td>
|
||||
<td>Long</td>
|
||||
<td><jsp:setProperty name="values" property="longValue" value="000${1}${7}"/>${values.longValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>000\${1}\${7}</td>
|
||||
<td>Long</td>
|
||||
<td><my:values long="000${1}${7}"/></td>
|
||||
</tr>
|
||||
<!--
|
||||
Undefined values are to be coerced to String, to be "",
|
||||
https://bz.apache.org/bugzilla/show_bug.cgi?id=47413
|
||||
-->
|
||||
<tr>
|
||||
<td>\${undefinedFoo}hello world\${undefinedBar}</td>
|
||||
<td>String</td>
|
||||
<td><jsp:setProperty name="values" property="stringValue" value="${undefinedFoo}hello world${undefinedBar}"/>${values.stringValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}hello world\${undefinedBar}</td>
|
||||
<td>String</td>
|
||||
<td><my:values string="${undefinedFoo}hello world${undefinedBar}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Double</td>
|
||||
<td><jsp:setProperty name="values" property="doubleValue" value="${undefinedFoo}${undefinedBar}"/>${values.doubleValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Double</td>
|
||||
<td><my:values double="${undefinedFoo}${undefinedBar}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Long</td>
|
||||
<td><jsp:setProperty name="values" property="longValue" value="${undefinedFoo}${undefinedBar}"/>${values.longValue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${undefinedFoo}\${undefinedBar}</td>
|
||||
<td>Long</td>
|
||||
<td><my:values long="${undefinedFoo}${undefinedBar}"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</code>
|
||||
</blockquote>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</pre></body></html>
|
||||
32
tomcat/webapps.dist/examples/jsp/jsp2/el/functions.html
Normal file
32
tomcat/webapps.dist/examples/jsp/jsp2/el/functions.html
Normal 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>
|
||||
67
tomcat/webapps.dist/examples/jsp/jsp2/el/functions.jsp
Normal file
67
tomcat/webapps.dist/examples/jsp/jsp2/el/functions.jsp
Normal file
@@ -0,0 +1,67 @@
|
||||
<%--
|
||||
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.
|
||||
--%>
|
||||
<%@page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="my" uri="http://tomcat.apache.org/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"])} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${my:reverse(param["foo"])}</td>
|
||||
<td>${my:reverse(fn:escapeXml(param["foo"]))} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${my:reverse(my:reverse(param["foo"]))}</td>
|
||||
<td>${my:reverse(my:reverse(fn:escapeXml(param["foo"])))} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${my:countVowels(param["foo"])}</td>
|
||||
<td>${my:countVowels(fn:escapeXml(param["foo"]))} </td>
|
||||
</tr>
|
||||
</table>
|
||||
</code>
|
||||
</blockquote>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
68
tomcat/webapps.dist/examples/jsp/jsp2/el/functions.jsp.html
Normal file
68
tomcat/webapps.dist/examples/jsp/jsp2/el/functions.jsp.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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.
|
||||
--%>
|
||||
<%@page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="my" uri="http://tomcat.apache.org/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>
|
||||
|
||||
</pre></body></html>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,90 @@
|
||||
<%--
|
||||
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.
|
||||
--%>
|
||||
<%@page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ 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 Language. 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"])} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${param["foo"]}</td>
|
||||
<td>${fn:escapeXml(param["foo"])} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${header["host"]}</td>
|
||||
<td>${fn:escapeXml(header["host"])} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${header["accept"]}</td>
|
||||
<td>${fn:escapeXml(header["accept"])} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>\${header["user-agent"]}</td>
|
||||
<td>${fn:escapeXml(header["user-agent"])} </td>
|
||||
</tr>
|
||||
</table>
|
||||
</code>
|
||||
</blockquote>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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.
|
||||
--%>
|
||||
<%@page contentType="text/html; charset=UTF-8" %>
|
||||
<%@ 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 Language. 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>
|
||||
</pre></body></html>
|
||||
Reference in New Issue
Block a user