소스 파일 최초 업로드

This commit is contained in:
ByeonJungHun
2024-04-05 10:31:45 +09:00
commit 718e6822af
682 changed files with 90848 additions and 0 deletions

View 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.
*
* &lt;p>Each function is defined as a static method.&lt;/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 &lt; 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>

View File

@@ -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>

View 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>

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,89 @@
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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 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>

View File

@@ -0,0 +1,117 @@
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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 gt (4/2)}&lt;/td>
&lt;td>${1 gt (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,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>

View 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>

View File

@@ -0,0 +1,111 @@
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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="my" uri="http://tomcat.apache.org/example-taglib" %>
&lt;html>
&lt;head>
&lt;title>JSP 2.0 Expression Language - Composite Expressions&lt;/title>
&lt;/head>
&lt;body>
&lt;h1>JSP 2.0 Expression Language - Composite Expressions&lt;/h1>
&lt;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.
&lt;jsp:useBean id="values" class="jsp2.examples.ValuesBean" />
&lt;blockquote>
&lt;code>
&lt;table border="1">
&lt;thead>
&lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
&lt;td>&lt;b>Type&lt;/b>&lt;/td>
&lt;td>&lt;b>Result&lt;/b>&lt;/td>
&lt;/thead>
&lt;tr>
&lt;td>\${'hello'} wo\${'rld'}&lt;/td>
&lt;td>String&lt;/td>
&lt;td>&lt;jsp:setProperty name="values" property="stringValue" value="${'hello'} wo${'rld'}"/>${values.stringValue}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${'hello'} wo\${'rld'}&lt;/td>
&lt;td>String&lt;/td>
&lt;td>&lt;my:values string="${'hello'} wo${'rld'}"/>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1+2}.\${220}&lt;/td>
&lt;td>Double&lt;/td>
&lt;td>&lt;jsp:setProperty name="values" property="doubleValue" value="${1+2}.${220}"/>${values.doubleValue}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${1+2}.\${220}&lt;/td>
&lt;td>Double&lt;/td>
&lt;td>&lt;my:values double="${1+2}.${220}"/>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>000\${1}\${7}&lt;/td>
&lt;td>Long&lt;/td>
&lt;td>&lt;jsp:setProperty name="values" property="longValue" value="000${1}${7}"/>${values.longValue}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>000\${1}\${7}&lt;/td>
&lt;td>Long&lt;/td>
&lt;td>&lt;my:values long="000${1}${7}"/>&lt;/td>
&lt;/tr>
&lt;!--
Undefined values are to be coerced to String, to be "",
https://bz.apache.org/bugzilla/show_bug.cgi?id=47413
-->
&lt;tr>
&lt;td>\${undefinedFoo}hello world\${undefinedBar}&lt;/td>
&lt;td>String&lt;/td>
&lt;td>&lt;jsp:setProperty name="values" property="stringValue" value="${undefinedFoo}hello world${undefinedBar}"/>${values.stringValue}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${undefinedFoo}hello world\${undefinedBar}&lt;/td>
&lt;td>String&lt;/td>
&lt;td>&lt;my:values string="${undefinedFoo}hello world${undefinedBar}"/>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${undefinedFoo}\${undefinedBar}&lt;/td>
&lt;td>Double&lt;/td>
&lt;td>&lt;jsp:setProperty name="values" property="doubleValue" value="${undefinedFoo}${undefinedBar}"/>${values.doubleValue}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${undefinedFoo}\${undefinedBar}&lt;/td>
&lt;td>Double&lt;/td>
&lt;td>&lt;my:values double="${undefinedFoo}${undefinedBar}"/>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${undefinedFoo}\${undefinedBar}&lt;/td>
&lt;td>Long&lt;/td>
&lt;td>&lt;jsp:setProperty name="values" property="longValue" value="${undefinedFoo}${undefinedBar}"/>${values.longValue}&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\${undefinedFoo}\${undefinedBar}&lt;/td>
&lt;td>Long&lt;/td>
&lt;td>&lt;my:values long="${undefinedFoo}${undefinedBar}"/>&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,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"])}&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 @@
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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;%@page contentType="text/html; charset=UTF-8" %>
&lt;%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
&lt;%@ taglib prefix="my" uri="http://tomcat.apache.org/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,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"])}&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 @@
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><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;%@page contentType="text/html; charset=UTF-8" %>
&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 Language. 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>