升级Tomcat版本 apache-tomcat-7.0.77
diff --git a/tomcat-cas/webapps/examples/jsp/chat/login.jsp b/tomcat-cas/webapps/examples/jsp/async/async1.jsp
similarity index 63%
rename from tomcat-cas/webapps/examples/jsp/chat/login.jsp
rename to tomcat-cas/webapps/examples/jsp/async/async1.jsp
index e1c6496..fb6fa2d 100644
--- a/tomcat-cas/webapps/examples/jsp/chat/login.jsp
+++ b/tomcat-cas/webapps/examples/jsp/async/async1.jsp
@@ -1,7 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%@page contentType="text/html; charset=UTF-8" %>
-<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.
@@ -16,18 +13,14 @@
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>JSP Chat</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<form method="POST" action='chat' target="_top" name="loginForm">
-<input type="hidden" name="action" value="login">
-Nickname: <input type="text" name="nickname">
-<input type="submit">
-</form>
-
-</body>
-</html>
+--%>
+<%@page session="false"%>
+Output from async1.jsp
+Type is <%=request.getDispatcherType()%>
+<%
+System.out.println("Inside Async 1");
+ if (request.isAsyncStarted()) {
+ request.getAsyncContext().complete();
+ }
+%>
+Completed async request at <%=new java.sql.Date(System.currentTimeMillis())%>
\ No newline at end of file
diff --git a/tomcat-cas/webapps/examples/jsp/chat/login.jsp b/tomcat-cas/webapps/examples/jsp/async/async1.jsp.html
similarity index 63%
copy from tomcat-cas/webapps/examples/jsp/chat/login.jsp
copy to tomcat-cas/webapps/examples/jsp/async/async1.jsp.html
index e1c6496..4c460b8 100644
--- a/tomcat-cas/webapps/examples/jsp/chat/login.jsp
+++ b/tomcat-cas/webapps/examples/jsp/async/async1.jsp.html
@@ -1,7 +1,5 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%@page contentType="text/html; charset=UTF-8" %>
-<html>
-<!--
+<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.
@@ -16,18 +14,15 @@
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>JSP Chat</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<form method="POST" action='chat' target="_top" name="loginForm">
-<input type="hidden" name="action" value="login">
-Nickname: <input type="text" name="nickname">
-<input type="submit">
-</form>
-
-</body>
-</html>
+--%>
+<%@page session="false"%>
+Output from async1.jsp
+Type is <%=request.getDispatcherType()%>
+<%
+System.out.println("Inside Async 1");
+ if (request.isAsyncStarted()) {
+ request.getAsyncContext().complete();
+ }
+%>
+Completed async request at <%=new java.sql.Date(System.currentTimeMillis())%>
+</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/chat/login.jsp b/tomcat-cas/webapps/examples/jsp/async/async3.jsp
similarity index 63%
copy from tomcat-cas/webapps/examples/jsp/chat/login.jsp
copy to tomcat-cas/webapps/examples/jsp/async/async3.jsp
index e1c6496..c16d5d7 100644
--- a/tomcat-cas/webapps/examples/jsp/chat/login.jsp
+++ b/tomcat-cas/webapps/examples/jsp/async/async3.jsp
@@ -1,7 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%@page contentType="text/html; charset=UTF-8" %>
-<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.
@@ -16,18 +13,8 @@
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>JSP Chat</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<form method="POST" action='chat' target="_top" name="loginForm">
-<input type="hidden" name="action" value="login">
-Nickname: <input type="text" name="nickname">
-<input type="submit">
-</form>
-
-</body>
-</html>
+--%>
+<%@page session="false"%>
+Output from async3.jsp
+Type is <%=request.getDispatcherType()%>
+Completed async 3 request at <%=new java.sql.Date(System.currentTimeMillis())%>
\ No newline at end of file
diff --git a/tomcat-cas/webapps/examples/jsp/chat/login.jsp b/tomcat-cas/webapps/examples/jsp/async/async3.jsp.html
similarity index 63%
copy from tomcat-cas/webapps/examples/jsp/chat/login.jsp
copy to tomcat-cas/webapps/examples/jsp/async/async3.jsp.html
index e1c6496..ad77ae9 100644
--- a/tomcat-cas/webapps/examples/jsp/chat/login.jsp
+++ b/tomcat-cas/webapps/examples/jsp/async/async3.jsp.html
@@ -1,7 +1,5 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%@page contentType="text/html; charset=UTF-8" %>
-<html>
-<!--
+<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.
@@ -16,18 +14,9 @@
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>JSP Chat</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<form method="POST" action='chat' target="_top" name="loginForm">
-<input type="hidden" name="action" value="login">
-Nickname: <input type="text" name="nickname">
-<input type="submit">
-</form>
-
-</body>
-</html>
+--%>
+<%@page session="false"%>
+Output from async3.jsp
+Type is <%=request.getDispatcherType()%>
+Completed async 3 request at <%=new java.sql.Date(System.currentTimeMillis())%>
+</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/async/index.jsp b/tomcat-cas/webapps/examples/jsp/async/index.jsp
new file mode 100644
index 0000000..28af9ac
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/async/index.jsp
@@ -0,0 +1,69 @@
+<%--
+ 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 session="false"%>
+
+<pre>
+Use cases:
+
+1. Simple dispatch
+ - servlet does startAsync()
+ - background thread calls ctx.dispatch()
+ <a href="<%=response.encodeURL("/examples/async/async0")%>"> Async 0 </a>
+
+2. Simple dispatch
+ - servlet does startAsync()
+ - background thread calls dispatch(/path/to/jsp)
+ <a href="<%=response.encodeURL("/examples/async/async1")%>"> Async 1 </a>
+
+3. Simple dispatch
+ - servlet does startAsync()
+ - background thread calls writes and calls complete()
+ <a href="<%=response.encodeURL("/examples/async/async2")%>"> Async 2 </a>
+
+4. Simple dispatch
+ - servlet does a startAsync()
+ - servlet calls dispatch(/path/to/jsp)
+ - servlet calls complete()
+ <a href="<%=response.encodeURL("/examples/async/async3")%>"> Async 3 </a>
+
+3. Timeout s1
+ - servlet does a startAsync()
+ - servlet does a setAsyncTimeout
+ - returns - waits for timeout to happen should return error page
+
+4. Timeout s2
+ - servlet does a startAsync()
+ - servlet does a setAsyncTimeout
+ - servlet does a addAsyncListener
+ - returns - waits for timeout to happen and listener invoked
+
+5. Dispatch to asyncSupported=false servlet
+ - servlet1 does a startAsync()
+ - servlet1 dispatches to dispatch(/servlet2)
+ - the container calls complete() after servlet2 is complete
+ - TODO
+
+6. Chained dispatch
+ - servlet1 does a startAsync
+ - servlet1 does a dispatch to servlet2 (asyncsupported=true)
+ - servlet2 does a dispatch to servlet3 (asyncsupported=true)
+ - servlet3 does a dispatch to servlet4 (asyncsupported=false)
+
+
+7. Stock ticker
+ <a href="<%=response.encodeURL("/examples/async/stockticker")%>"> StockTicker </a>
+</pre>
\ No newline at end of file
diff --git a/tomcat-cas/webapps/examples/jsp/async/index.jsp.html b/tomcat-cas/webapps/examples/jsp/async/index.jsp.html
new file mode 100644
index 0000000..6f124b5
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/async/index.jsp.html
@@ -0,0 +1,71 @@
+<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.
+--%>
+<%@page session="false"%>
+
+<pre>
+Use cases:
+
+1. Simple dispatch
+ - servlet does startAsync()
+ - background thread calls ctx.dispatch()
+ <a href="<%=response.encodeURL("/examples/async/async0")%>"> Async 0 </a>
+
+2. Simple dispatch
+ - servlet does startAsync()
+ - background thread calls dispatch(/path/to/jsp)
+ <a href="<%=response.encodeURL("/examples/async/async1")%>"> Async 1 </a>
+
+3. Simple dispatch
+ - servlet does startAsync()
+ - background thread calls writes and calls complete()
+ <a href="<%=response.encodeURL("/examples/async/async2")%>"> Async 2 </a>
+
+4. Simple dispatch
+ - servlet does a startAsync()
+ - servlet calls dispatch(/path/to/jsp)
+ - servlet calls complete()
+ <a href="<%=response.encodeURL("/examples/async/async3")%>"> Async 3 </a>
+
+3. Timeout s1
+ - servlet does a startAsync()
+ - servlet does a setAsyncTimeout
+ - returns - waits for timeout to happen should return error page
+
+4. Timeout s2
+ - servlet does a startAsync()
+ - servlet does a setAsyncTimeout
+ - servlet does a addAsyncListener
+ - returns - waits for timeout to happen and listener invoked
+
+5. Dispatch to asyncSupported=false servlet
+ - servlet1 does a startAsync()
+ - servlet1 dispatches to dispatch(/servlet2)
+ - the container calls complete() after servlet2 is complete
+ - TODO
+
+6. Chained dispatch
+ - servlet1 does a startAsync
+ - servlet1 does a dispatch to servlet2 (asyncsupported=true)
+ - servlet2 does a dispatch to servlet3 (asyncsupported=true)
+ - servlet3 does a dispatch to servlet4 (asyncsupported=false)
+
+
+7. Stock ticker
+ <a href="<%=response.encodeURL("/examples/async/stockticker")%>"> StockTicker </a>
+</pre>
+</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/Entries.java.html b/tomcat-cas/webapps/examples/jsp/cal/Entries.java.html
index 6093d31..289363b 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/Entries.java.html
+++ b/tomcat-cas/webapps/examples/jsp/cal/Entries.java.html
@@ -1,74 +1,62 @@
<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.
-*/
+ * 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 cal;
import java.util.Hashtable;
-import javax.servlet.http.*;
+
+import javax.servlet.http.HttpServletRequest;
public class Entries {
- private Hashtable entries;
- private static final String[] time = {"8am", "9am", "10am", "11am", "12pm",
- "1pm", "2pm", "3pm", "4pm", "5pm", "6pm",
- "7pm", "8pm" };
- public static final int rows = 12;
+ private Hashtable<String, Entry> entries;
+ private static final String[] time = { "8am", "9am", "10am", "11am",
+ "12pm", "1pm", "2pm", "3pm", "4pm", "5pm", "6pm", "7pm", "8pm" };
+ public static final int rows = 12;
- public Entries () {
- entries = new Hashtable (rows);
- for (int i=0; i < rows; i++) {
- entries.put (time[i], new Entry(time[i]));
- }
- }
-
- public int getRows () {
- return rows;
- }
-
- public Entry getEntry (int index) {
- return (Entry)this.entries.get(time[index]);
- }
-
- public int getIndex (String tm) {
- for (int i=0; i<rows; i++)
- if(tm.equals(time[i])) return i;
- return -1;
- }
-
- public void processRequest (HttpServletRequest request, String tm) {
- int index = getIndex (tm);
- if (index >= 0) {
- String descr = request.getParameter ("description");
- ((Entry)entries.get(time[index])).setDescription (descr);
+ public Entries() {
+ entries = new Hashtable<String, Entry>(rows);
+ for (int i = 0; i < rows; i++) {
+ entries.put(time[i], new Entry(time[i]));
+ }
}
- }
+
+ public int getRows() {
+ return rows;
+ }
+
+ public Entry getEntry(int index) {
+ return this.entries.get(time[index]);
+ }
+
+ public int getIndex(String tm) {
+ for (int i = 0; i < rows; i++)
+ if (tm.equals(time[i]))
+ return i;
+ return -1;
+ }
+
+ public void processRequest(HttpServletRequest request, String tm) {
+ int index = getIndex(tm);
+ if (index >= 0) {
+ String descr = request.getParameter("description");
+ entries.get(time[index]).setDescription(descr);
+ }
+ }
}
-
-
-
-
-
-
-
-
-
-
-
-
-
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/Entry.java.html b/tomcat-cas/webapps/examples/jsp/cal/Entry.java.html
index f982750..4e97bc1 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/Entry.java.html
+++ b/tomcat-cas/webapps/examples/jsp/cal/Entry.java.html
@@ -1,57 +1,55 @@
<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.
-*/
+ * 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 cal;
public class Entry {
- String hour;
- String description;
- String color;
+ String hour;
+ String description;
- public Entry (String hour) {
- this.hour = hour;
- this.description = "";
+ public Entry(String hour) {
+ this.hour = hour;
+ this.description = "";
- }
+ }
- public String getHour () {
- return this.hour;
- }
+ public String getHour() {
+ return this.hour;
+ }
- public String getColor () {
- if (description.equals("")) return "lightblue";
- else return "red";
- }
+ public String getColor() {
+ if (description.equals("")) {
+ return "lightblue";
+ }
+ return "red";
+ }
- public String getDescription () {
- if (description.equals("")) return "None";
- else return this.description;
- }
+ public String getDescription() {
+ if (description.equals("")) {
+ return "None";
+ }
+ return this.description;
+ }
- public void setDescription (String descr) {
- description = descr;
- }
-
+ public void setDescription(String descr) {
+ description = descr;
+ }
+
}
-
-
-
-
-
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/JspCalendar.java.html b/tomcat-cas/webapps/examples/jsp/cal/JspCalendar.java.html
index e1b4b83..3c04fd1 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/JspCalendar.java.html
+++ b/tomcat-cas/webapps/examples/jsp/cal/JspCalendar.java.html
@@ -18,139 +18,136 @@
package cal;
-import java.util.*;
+import java.util.Calendar;
+import java.util.Date;
public class JspCalendar {
Calendar calendar = null;
- Date currentDate;
public JspCalendar() {
- calendar = Calendar.getInstance();
- Date trialTime = new Date();
- calendar.setTime(trialTime);
+ calendar = Calendar.getInstance();
+ Date trialTime = new Date();
+ calendar.setTime(trialTime);
}
public int getYear() {
- return calendar.get(Calendar.YEAR);
+ return calendar.get(Calendar.YEAR);
}
-
+
public String getMonth() {
- int m = getMonthInt();
- String[] months = new String [] { "January", "February", "March",
- "April", "May", "June",
- "July", "August", "September",
- "October", "November", "December" };
- if (m > 12)
- return "Unknown to Man";
-
- return months[m - 1];
+ int m = getMonthInt();
+ String[] months = new String [] { "January", "February", "March",
+ "April", "May", "June",
+ "July", "August", "September",
+ "October", "November", "December" };
+ if (m > 12)
+ return "Unknown to Man";
+
+ return months[m - 1];
}
public String getDay() {
- int x = getDayOfWeek();
- String[] days = new String[] {"Sunday", "Monday", "Tuesday", "Wednesday",
- "Thursday", "Friday", "Saturday"};
+ int x = getDayOfWeek();
+ String[] days = new String[] {"Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"};
- if (x > 7)
- return "Unknown to Man";
+ if (x > 7)
+ return "Unknown to Man";
- return days[x - 1];
+ return days[x - 1];
}
-
+
public int getMonthInt() {
- return 1 + calendar.get(Calendar.MONTH);
+ return 1 + calendar.get(Calendar.MONTH);
}
public String getDate() {
- return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
+ return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
}
public String getCurrentDate() {
Date dt = new Date ();
- calendar.setTime (dt);
- return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
+ calendar.setTime (dt);
+ return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
}
public String getNextDate() {
calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() + 1);
- return getDate ();
+ return getDate ();
}
public String getPrevDate() {
calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() - 1);
- return getDate ();
+ return getDate ();
}
public String getTime() {
- return getHour() + ":" + getMinute() + ":" + getSecond();
+ return getHour() + ":" + getMinute() + ":" + getSecond();
}
public int getDayOfMonth() {
- return calendar.get(Calendar.DAY_OF_MONTH);
+ return calendar.get(Calendar.DAY_OF_MONTH);
}
public int getDayOfYear() {
- return calendar.get(Calendar.DAY_OF_YEAR);
+ return calendar.get(Calendar.DAY_OF_YEAR);
}
public int getWeekOfYear() {
- return calendar.get(Calendar.WEEK_OF_YEAR);
+ return calendar.get(Calendar.WEEK_OF_YEAR);
}
public int getWeekOfMonth() {
- return calendar.get(Calendar.WEEK_OF_MONTH);
+ return calendar.get(Calendar.WEEK_OF_MONTH);
}
public int getDayOfWeek() {
- return calendar.get(Calendar.DAY_OF_WEEK);
+ return calendar.get(Calendar.DAY_OF_WEEK);
}
-
+
public int getHour() {
- return calendar.get(Calendar.HOUR_OF_DAY);
+ return calendar.get(Calendar.HOUR_OF_DAY);
}
-
+
public int getMinute() {
- return calendar.get(Calendar.MINUTE);
+ return calendar.get(Calendar.MINUTE);
}
public int getSecond() {
- return calendar.get(Calendar.SECOND);
+ return calendar.get(Calendar.SECOND);
}
-
+
public int getEra() {
- return calendar.get(Calendar.ERA);
+ return calendar.get(Calendar.ERA);
}
public String getUSTimeZone() {
- String[] zones = new String[] {"Hawaii", "Alaskan", "Pacific",
- "Mountain", "Central", "Eastern"};
-
- return zones[10 + getZoneOffset()];
+ String[] zones = new String[] {"Hawaii", "Alaskan", "Pacific",
+ "Mountain", "Central", "Eastern"};
+
+ return zones[10 + getZoneOffset()];
}
public int getZoneOffset() {
- return calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000);
+ return calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000);
}
public int getDSTOffset() {
- return calendar.get(Calendar.DST_OFFSET)/(60*60*1000);
+ return calendar.get(Calendar.DST_OFFSET)/(60*60*1000);
}
-
+
public int getAMPM() {
- return calendar.get(Calendar.AM_PM);
+ return calendar.get(Calendar.AM_PM);
}
}
-
-
-
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/TableBean.java.html b/tomcat-cas/webapps/examples/jsp/cal/TableBean.java.html
index a81a66b..78c0e7f 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/TableBean.java.html
+++ b/tomcat-cas/webapps/examples/jsp/cal/TableBean.java.html
@@ -1,102 +1,103 @@
<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.
-*/
+ * 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 cal;
-import javax.servlet.http.*;
import java.util.Hashtable;
+import javax.servlet.http.HttpServletRequest;
+
public class TableBean {
- Hashtable table;
- JspCalendar JspCal;
- Entries entries;
- String date;
- String name = null;
- String email = null;
- boolean processError = false;
+ Hashtable<String, Entries> table;
+ JspCalendar JspCal;
+ Entries entries;
+ String date;
+ String name = null;
+ String email = null;
+ boolean processError = false;
- public TableBean () {
- this.table = new Hashtable (10);
- this.JspCal = new JspCalendar ();
- this.date = JspCal.getCurrentDate ();
- }
-
- public void setName (String nm) {
- this.name = nm;
- }
-
- public String getName () {
- return this.name;
- }
-
- public void setEmail (String mail) {
- this.email = mail;
- }
-
- public String getEmail () {
- return this.email;
- }
-
- public String getDate () {
- return this.date;
- }
-
- public Entries getEntries () {
- return this.entries;
- }
-
- public void processRequest (HttpServletRequest request) {
-
- // Get the name and e-mail.
- this.processError = false;
- if (name == null || name.equals("")) setName(request.getParameter ("name"));
- if (email == null || email.equals("")) setEmail(request.getParameter ("email"));
- if (name == null || email == null ||
- name.equals("") || email.equals("")) {
- this.processError = true;
- return;
+ public TableBean() {
+ this.table = new Hashtable<String, Entries>(10);
+ this.JspCal = new JspCalendar();
+ this.date = JspCal.getCurrentDate();
}
- // Get the date.
- String dateR = request.getParameter ("date");
- if (dateR == null) date = JspCal.getCurrentDate ();
- else if (dateR.equalsIgnoreCase("next")) date = JspCal.getNextDate ();
- else if (dateR.equalsIgnoreCase("prev")) date = JspCal.getPrevDate ();
-
- entries = (Entries) table.get (date);
- if (entries == null) {
- entries = new Entries ();
- table.put (date, entries);
+ public void setName(String nm) {
+ this.name = nm;
}
- // If time is provided add the event.
- String time = request.getParameter("time");
- if (time != null) entries.processRequest (request, time);
- }
+ public String getName() {
+ return this.name;
+ }
- public boolean getProcessError () {
- return this.processError;
- }
+ public void setEmail(String mail) {
+ this.email = mail;
+ }
+
+ public String getEmail() {
+ return this.email;
+ }
+
+ public String getDate() {
+ return this.date;
+ }
+
+ public Entries getEntries() {
+ return this.entries;
+ }
+
+ public void processRequest(HttpServletRequest request) {
+
+ // Get the name and e-mail.
+ this.processError = false;
+ if (name == null || name.equals(""))
+ setName(request.getParameter("name"));
+ if (email == null || email.equals(""))
+ setEmail(request.getParameter("email"));
+ if (name == null || email == null || name.equals("")
+ || email.equals("")) {
+ this.processError = true;
+ return;
+ }
+
+ // Get the date.
+ String dateR = request.getParameter("date");
+ if (dateR == null)
+ date = JspCal.getCurrentDate();
+ else if (dateR.equalsIgnoreCase("next"))
+ date = JspCal.getNextDate();
+ else if (dateR.equalsIgnoreCase("prev"))
+ date = JspCal.getPrevDate();
+
+ entries = table.get(date);
+ if (entries == null) {
+ entries = new Entries();
+ table.put(date, entries);
+ }
+
+ // If time is provided add the event.
+ String time = request.getParameter("time");
+ if (time != null)
+ entries.processRequest(request, time);
+ }
+
+ public boolean getProcessError() {
+ return this.processError;
+ }
}
-
-
-
-
-
-
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp b/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp
index a691df4..db78a03 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp
+++ b/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,9 +13,10 @@
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>
- Calendar: A JSP APPLICATION
+--%>
+<HTML>
+<HEAD><TITLE>
+ Calendar: A JSP APPLICATION
</TITLE></HEAD>
@@ -26,8 +26,8 @@
<jsp:useBean id="table" scope="session" class="cal.TableBean" />
<%
- table.processRequest(request);
- if (table.getProcessError() == false) {
+ table.processRequest(request);
+ if (table.getProcessError() == false) {
%>
<!-- html table goes here -->
@@ -48,20 +48,20 @@
</TR>
<FORM METHOD=POST ACTION=cal1.jsp>
<%
- for(int i=0; i<table.getEntries().getRows(); i++) {
- cal.Entry entr = table.getEntries().getEntry(i);
+ for(int i=0; i<table.getEntries().getRows(); i++) {
+ cal.Entry entr = table.getEntries().getEntry(i);
%>
- <TR>
- <TD>
- <A HREF=cal2.jsp?time=<%= entr.getHour() %>>
- <%= entr.getHour() %> </A>
- </TD>
- <TD BGCOLOR=<%= entr.getColor() %>>
- <% out.print(util.HTMLFilter.filter(entr.getDescription())); %>
- </TD>
- </TR>
+ <TR>
+ <TD>
+ <A HREF=cal2.jsp?time=<%= entr.getHour() %>>
+ <%= entr.getHour() %> </A>
+ </TD>
+ <TD BGCOLOR=<%= entr.getColor() %>>
+ <% out.print(util.HTMLFilter.filter(entr.getDescription())); %>
+ </TD>
+ </TR>
<%
- }
+ }
%>
</FORM>
</TABLE>
@@ -70,20 +70,20 @@
<!-- footer -->
<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
<TR>
-<TD ALIGN=CENTER> <% out.print(util.HTMLFilter.filter(table.getName())); %> :
- <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD>
+<TD ALIGN=CENTER> <% out.print(util.HTMLFilter.filter(table.getName())); %> :
+ <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD>
</TR>
</TABLE>
</CENTER>
<%
- } else {
+ } else {
%>
<font size=5>
- You must enter your name and email address correctly.
+ You must enter your name and email address correctly.
</font>
<%
- }
+ }
%>
@@ -91,5 +91,3 @@
</HTML>
-
-
diff --git a/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp.html b/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp.html
index f9c3689..e83627c 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/cal/cal1.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,9 +14,10 @@
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>
- Calendar: A JSP APPLICATION
+--%>
+<HTML>
+<HEAD><TITLE>
+ Calendar: A JSP APPLICATION
</TITLE></HEAD>
@@ -27,8 +27,8 @@
<jsp:useBean id="table" scope="session" class="cal.TableBean" />
<%
- table.processRequest(request);
- if (table.getProcessError() == false) {
+ table.processRequest(request);
+ if (table.getProcessError() == false) {
%>
<!-- html table goes here -->
@@ -49,20 +49,20 @@
</TR>
<FORM METHOD=POST ACTION=cal1.jsp>
<%
- for(int i=0; i<table.getEntries().getRows(); i++) {
- cal.Entry entr = table.getEntries().getEntry(i);
+ for(int i=0; i<table.getEntries().getRows(); i++) {
+ cal.Entry entr = table.getEntries().getEntry(i);
%>
- <TR>
- <TD>
- <A HREF=cal2.jsp?time=<%= entr.getHour() %>>
- <%= entr.getHour() %> </A>
- </TD>
- <TD BGCOLOR=<%= entr.getColor() %>>
- <% out.print(util.HTMLFilter.filter(entr.getDescription())); %>
- </TD>
- </TR>
+ <TR>
+ <TD>
+ <A HREF=cal2.jsp?time=<%= entr.getHour() %>>
+ <%= entr.getHour() %> </A>
+ </TD>
+ <TD BGCOLOR=<%= entr.getColor() %>>
+ <% out.print(util.HTMLFilter.filter(entr.getDescription())); %>
+ </TD>
+ </TR>
<%
- }
+ }
%>
</FORM>
</TABLE>
@@ -71,20 +71,20 @@
<!-- footer -->
<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
<TR>
-<TD ALIGN=CENTER> <% out.print(util.HTMLFilter.filter(table.getName())); %> :
- <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD>
+<TD ALIGN=CENTER> <% out.print(util.HTMLFilter.filter(table.getName())); %> :
+ <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD>
</TR>
</TABLE>
</CENTER>
<%
- } else {
+ } else {
%>
<font size=5>
- You must enter your name and email address correctly.
+ You must enter your name and email address correctly.
</font>
<%
- }
+ }
%>
@@ -92,6 +92,4 @@
</HTML>
-
-
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp b/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp
index b6d435b..b508870 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp
+++ b/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,18 +13,18 @@
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>
- Calendar: A JSP APPLICATION
+--%>
+<HTML>
+<HEAD><TITLE>
+ Calendar: A JSP APPLICATION
</TITLE></HEAD>
<BODY BGCOLOR="white">
<jsp:useBean id="table" scope="session" class="cal.TableBean" />
-<%
- String time = request.getParameter ("time");
+<%
+ String time = request.getParameter ("time");
%>
<FONT SIZE=5> Please add the following event:
@@ -33,7 +32,7 @@
<BR> Time <%= util.HTMLFilter.filter(time) %> </h3>
</FONT>
<FORM METHOD=POST ACTION=cal1.jsp>
-<BR>
+<BR>
<BR> <INPUT NAME="date" TYPE=HIDDEN VALUE="current">
<BR> <INPUT NAME="time" TYPE=HIDDEN VALUE="<%= util.HTMLFilter.filter(time) %>">
<BR> <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp.html b/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp.html
index 2548ce7..270c8b0 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/cal/cal2.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,18 +14,18 @@
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>
- Calendar: A JSP APPLICATION
+--%>
+<HTML>
+<HEAD><TITLE>
+ Calendar: A JSP APPLICATION
</TITLE></HEAD>
<BODY BGCOLOR="white">
<jsp:useBean id="table" scope="session" class="cal.TableBean" />
-<%
- String time = request.getParameter ("time");
+<%
+ String time = request.getParameter ("time");
%>
<FONT SIZE=5> Please add the following event:
@@ -34,7 +33,7 @@
<BR> Time <%= util.HTMLFilter.filter(time) %> </h3>
</FONT>
<FORM METHOD=POST ACTION=cal1.jsp>
-<BR>
+<BR>
<BR> <INPUT NAME="date" TYPE=HIDDEN VALUE="current">
<BR> <INPUT NAME="time" TYPE=HIDDEN VALUE="<%= util.HTMLFilter.filter(time) %>">
<BR> <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
diff --git a/tomcat-cas/webapps/examples/jsp/cal/login.html b/tomcat-cas/webapps/examples/jsp/cal/login.html
index 398b39b..b1105d5 100644
--- a/tomcat-cas/webapps/examples/jsp/cal/login.html
+++ b/tomcat-cas/webapps/examples/jsp/cal/login.html
@@ -17,30 +17,30 @@
-->
<head>
- <title> Login page for the calendar. </title>
+ <title> Login page for the calendar. </title>
</head>
<body bgcolor="white">
<center>
- <font size=7 color="red"> Please Enter the following information: </font>
+ <font size=7 color="red"> Please Enter the following information: </font>
<br>
- <form method=GET action=cal1.jsp>
+ <form method=GET action=cal1.jsp>
- <font size=5> Name <input type=text name="name" size=20>
- </font>
- <br>
- <font size=5> Email <input type=text name="email" size=20>
- </font>
- <br>
- <input type=submit name=action value="Submit">
+ <font size=5> Name <input type=text name="name" size=20>
+ </font>
+ <br>
+ <font size=5> Email <input type=text name="email" size=20>
+ </font>
+ <br>
+ <input type=submit name=action value="Submit">
- </form>
+ </form>
<hr>
-<font size=3 color="red"> Note: This application does not implement the complete
-functionality of a typical calendar application. It demonstrates a way JSP can be
-used with html tables and forms.</font>
+<font size=3 color="red"> Note: This application does not implement the complete
+functionality of a typical calendar application. It demonstrates a way JSP can
+be used with html tables and forms.</font>
</center>
</body>
diff --git a/tomcat-cas/webapps/examples/jsp/chat/index.jsp b/tomcat-cas/webapps/examples/jsp/chat/index.jsp
deleted file mode 100644
index b7bc0d0..0000000
--- a/tomcat-cas/webapps/examples/jsp/chat/index.jsp
+++ /dev/null
@@ -1,32 +0,0 @@
-<%@page contentType="text/html; charset=UTF-8" %>
-<% if (session.getAttribute("nickname") == null) {
- response.sendRedirect("login.jsp");
- return;
-}
-%>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
-<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>JSP Chat</title>
-</head>
-<frameset rows="1*,4*">
- <frame name="post" src="post.jsp" scrolling="no" title="Post message">
- <frame name="chat" src="chat" scrolling="yes" title="Chat">
-</frameset>
-</html>
diff --git a/tomcat-cas/webapps/examples/jsp/chat/index.jsp.html b/tomcat-cas/webapps/examples/jsp/chat/index.jsp.html
deleted file mode 100644
index 0b98ebf..0000000
--- a/tomcat-cas/webapps/examples/jsp/chat/index.jsp.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<html><body><pre>
-<%@page contentType="text/html; charset=UTF-8" %>
-<% if (session.getAttribute("nickname") == null) {
- response.sendRedirect("login.jsp");
- return;
-}
-%>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
-<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>JSP Chat</title>
-</head>
-<frameset rows="1*,4*">
- <frame name="post" src="post.jsp" scrolling="no" title="Post message">
- <frame name="chat" src="chat" scrolling="yes" title="Chat">
-</frameset>
-</html>
-</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/chat/login.jsp.html b/tomcat-cas/webapps/examples/jsp/chat/login.jsp.html
deleted file mode 100644
index d0fbe40..0000000
--- a/tomcat-cas/webapps/examples/jsp/chat/login.jsp.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<html><body><pre>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%@page contentType="text/html; charset=UTF-8" %>
-<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>JSP Chat</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<form method="POST" action='chat' target="_top" name="loginForm">
-<input type="hidden" name="action" value="login">
-Nickname: <input type="text" name="nickname">
-<input type="submit">
-</form>
-
-</body>
-</html>
-</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/chat/post.jsp b/tomcat-cas/webapps/examples/jsp/chat/post.jsp
deleted file mode 100644
index cc8134d..0000000
--- a/tomcat-cas/webapps/examples/jsp/chat/post.jsp
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%@page contentType="text/html; charset=UTF-8" %>
-<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>JSP Chat</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<form method="POST" action='chat' name="postForm">
-<input type="hidden" name="action" value="post">
-Message: <input type="text" name="message">
-<input type="submit">
-</form>
-
-<br>
-<%
- String serverName = request.getServerName();
- if ("localhost".equals(serverName)) {
- serverName = "127.0.0.1";
- } else if ("127.0.0.1".equals(serverName)) {
- serverName = "localhost";
- }
-
- String chatUrl = request.getScheme() + "://" + serverName + ":"
- + request.getServerPort() + request.getContextPath()
- + request.getServletPath();
-
- // strip "post.jsp" from the address
- chatUrl = chatUrl.substring(0, chatUrl.lastIndexOf("/") + 1);
-%>
-<a target="_blank" href="<%=chatUrl %>">Click to open a new chat window</a>
-<em>Note</em>: To avoid hitting the limit on the count of simultaneous
-connections to the same host, imposed by the
-<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4">HTTP specification</a>,
-the second chat window should be opened using a different URL, e.g. with
-an IP address instead of the host name.
-</body>
-</html>
diff --git a/tomcat-cas/webapps/examples/jsp/chat/post.jsp.html b/tomcat-cas/webapps/examples/jsp/chat/post.jsp.html
deleted file mode 100644
index 90fa323..0000000
--- a/tomcat-cas/webapps/examples/jsp/chat/post.jsp.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<html><body><pre>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<%@page contentType="text/html; charset=UTF-8" %>
-<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>JSP Chat</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<form method="POST" action='chat' name="postForm">
-<input type="hidden" name="action" value="post">
-Message: <input type="text" name="message">
-<input type="submit">
-</form>
-
-<br>
-<%
- String serverName = request.getServerName();
- if ("localhost".equals(serverName)) {
- serverName = "127.0.0.1";
- } else if ("127.0.0.1".equals(serverName)) {
- serverName = "localhost";
- }
-
- String chatUrl = request.getScheme() + "://" + serverName + ":"
- + request.getServerPort() + request.getContextPath()
- + request.getServletPath();
-
- // strip "post.jsp" from the address
- chatUrl = chatUrl.substring(0, chatUrl.lastIndexOf("/") + 1);
-%>
-<a target="_blank" href="<%=chatUrl %>">Click to open a new chat window</a>
-<em>Note</em>: To avoid hitting the limit on the count of simultaneous
-connections to the same host, imposed by the
-<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4">HTTP specification</a>,
-the second chat window should be opened using a different URL, e.g. with
-an IP address instead of the host name.
-</body>
-</html>
-</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp b/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp
index db87ca1..5df7b66 100644
--- a/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp
+++ b/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,8 +13,8 @@
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>
<body bgcolor="white">
<font size=5 color="red">
<%! String[] fruits; %>
@@ -24,19 +23,19 @@
<jsp:setProperty name="foo" property="fruit" param="fruit" />
<hr>
The checked fruits (got using request) are: <br>
-<%
- fruits = request.getParameterValues("fruit");
+<%
+ fruits = request.getParameterValues("fruit");
%>
<ul>
<%
if (fruits != null) {
- for (int i = 0; i < fruits.length; i++) {
+ for (int i = 0; i < fruits.length; i++) {
%>
<li>
<%
- out.println (util.HTMLFilter.filter(fruits[i]));
- }
- } else out.println ("none selected");
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
%>
</ul>
<br>
@@ -44,19 +43,19 @@
The checked fruits (got using beans) are <br>
-<%
- fruits = foo.getFruit();
+<%
+ fruits = foo.getFruit();
%>
<ul>
<%
if (!fruits[0].equals("1")) {
- for (int i = 0; i < fruits.length; i++) {
+ for (int i = 0; i < fruits.length; i++) {
%>
<li>
<%
- out.println (util.HTMLFilter.filter(fruits[i]));
- }
- } else out.println ("none selected");
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
%>
</ul>
</font>
diff --git a/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp.html b/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp.html
index d5442d1..5daab63 100644
--- a/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/checkbox/checkresult.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,8 +14,8 @@
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>
<body bgcolor="white">
<font size=5 color="red">
<%! String[] fruits; %>
@@ -25,19 +24,19 @@
<jsp:setProperty name="foo" property="fruit" param="fruit" />
<hr>
The checked fruits (got using request) are: <br>
-<%
- fruits = request.getParameterValues("fruit");
+<%
+ fruits = request.getParameterValues("fruit");
%>
<ul>
<%
if (fruits != null) {
- for (int i = 0; i < fruits.length; i++) {
+ for (int i = 0; i < fruits.length; i++) {
%>
<li>
<%
- out.println (util.HTMLFilter.filter(fruits[i]));
- }
- } else out.println ("none selected");
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
%>
</ul>
<br>
@@ -45,19 +44,19 @@
The checked fruits (got using beans) are <br>
-<%
- fruits = foo.getFruit();
+<%
+ fruits = foo.getFruit();
%>
<ul>
<%
if (!fruits[0].equals("1")) {
- for (int i = 0; i < fruits.length; i++) {
+ for (int i = 0; i < fruits.length; i++) {
%>
<li>
<%
- out.println (util.HTMLFilter.filter(fruits[i]));
- }
- } else out.println ("none selected");
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
%>
</ul>
</font>
diff --git a/tomcat-cas/webapps/examples/jsp/colors/colors.html b/tomcat-cas/webapps/examples/jsp/colors/colors.html
index 086738d..76ec2b9 100644
--- a/tomcat-cas/webapps/examples/jsp/colors/colors.html
+++ b/tomcat-cas/webapps/examples/jsp/colors/colors.html
@@ -20,16 +20,16 @@
<font size=6 color=red>
<hr>
-This web page is an example using JSP and BEANs.
+This web page is an example using JSP and BEANs.
<p>
-Guess my favorite two colors
+Guess my favorite two colors
<p> If you fail to guess both of them - you get yellow on red.
-<p> If you guess one of them right, either your foreground or
+<p> If you guess one of them right, either your foreground or
your background will change to the color that was guessed right.
-<p> Guess them both right and your browser foreground/background
+<p> Guess them both right and your browser foreground/background
will change to my two favorite colors to display this page.
<hr>
diff --git a/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp b/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp
index e433bbd..90e1afe 100644
--- a/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp
+++ b/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,13 +13,14 @@
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>
<jsp:useBean id="cb" scope="session" class="colors.ColorGameBean" />
<jsp:setProperty name="cb" property="*" />
<%
- cb.processRequest(request);
+ cb.processRequest();
%>
<body bgcolor=<%= cb.getColor1() %>>
@@ -28,20 +28,20 @@
<p>
<% if (cb.getHint()==true) { %>
-
- <p> Hint #1: Vampires prey at night!
- <p> <p> Hint #2: Nancy without the n.
+
+ <p> Hint #1: Vampires prey at night!
+ <p> <p> Hint #2: Nancy without the n.
<% } %>
<% if (cb.getSuccess()==true) { %>
<p> CONGRATULATIONS!!
- <% if (cb.getHintTaken()==true) { %>
-
+ <% if (cb.getHintTaken()==true) { %>
+
<p> ( although I know you cheated and peeked into the hints)
- <% } %>
+ <% } %>
<% } %>
diff --git a/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp.html b/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp.html
index 41af88b..fda1bd7 100644
--- a/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/colors/colrs.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,13 +14,14 @@
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>
<jsp:useBean id="cb" scope="session" class="colors.ColorGameBean" />
<jsp:setProperty name="cb" property="*" />
<%
- cb.processRequest(request);
+ cb.processRequest();
%>
<body bgcolor=<%= cb.getColor1() %>>
@@ -29,20 +29,20 @@
<p>
<% if (cb.getHint()==true) { %>
-
- <p> Hint #1: Vampires prey at night!
- <p> <p> Hint #2: Nancy without the n.
+
+ <p> Hint #1: Vampires prey at night!
+ <p> <p> Hint #2: Nancy without the n.
<% } %>
<% if (cb.getSuccess()==true) { %>
<p> CONGRATULATIONS!!
- <% if (cb.getHintTaken()==true) { %>
-
+ <% if (cb.getHintTaken()==true) { %>
+
<p> ( although I know you cheated and peeked into the hints)
- <% } %>
+ <% } %>
<% } %>
diff --git a/tomcat-cas/webapps/examples/jsp/dates/date.jsp b/tomcat-cas/webapps/examples/jsp/dates/date.jsp
index 9c40d78..7f47dc9 100644
--- a/tomcat-cas/webapps/examples/jsp/dates/date.jsp
+++ b/tomcat-cas/webapps/examples/jsp/dates/date.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,7 +13,8 @@
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>
<%@ page session="false"%>
@@ -23,17 +23,17 @@
<font size=4>
<ul>
-<li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/>
-<li> Year: is <jsp:getProperty name="clock" property="year"/>
-<li> Month: is <jsp:getProperty name="clock" property="month"/>
-<li> Time: is <jsp:getProperty name="clock" property="time"/>
-<li> Date: is <jsp:getProperty name="clock" property="date"/>
-<li> Day: is <jsp:getProperty name="clock" property="day"/>
-<li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/>
-<li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/>
-<li> era: is <jsp:getProperty name="clock" property="era"/>
-<li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/>
-<li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/>
+<li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/>
+<li> Year: is <jsp:getProperty name="clock" property="year"/>
+<li> Month: is <jsp:getProperty name="clock" property="month"/>
+<li> Time: is <jsp:getProperty name="clock" property="time"/>
+<li> Date: is <jsp:getProperty name="clock" property="date"/>
+<li> Day: is <jsp:getProperty name="clock" property="day"/>
+<li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/>
+<li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/>
+<li> era: is <jsp:getProperty name="clock" property="era"/>
+<li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/>
+<li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/>
</ul>
</font>
diff --git a/tomcat-cas/webapps/examples/jsp/dates/date.jsp.html b/tomcat-cas/webapps/examples/jsp/dates/date.jsp.html
index 4a8f1e9..c7eb8d5 100644
--- a/tomcat-cas/webapps/examples/jsp/dates/date.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/dates/date.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,7 +14,8 @@
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>
<%@ page session="false"%>
@@ -24,17 +24,17 @@
<font size=4>
<ul>
-<li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/>
-<li> Year: is <jsp:getProperty name="clock" property="year"/>
-<li> Month: is <jsp:getProperty name="clock" property="month"/>
-<li> Time: is <jsp:getProperty name="clock" property="time"/>
-<li> Date: is <jsp:getProperty name="clock" property="date"/>
-<li> Day: is <jsp:getProperty name="clock" property="day"/>
-<li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/>
-<li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/>
-<li> era: is <jsp:getProperty name="clock" property="era"/>
-<li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/>
-<li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/>
+<li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/>
+<li> Year: is <jsp:getProperty name="clock" property="year"/>
+<li> Month: is <jsp:getProperty name="clock" property="month"/>
+<li> Time: is <jsp:getProperty name="clock" property="time"/>
+<li> Date: is <jsp:getProperty name="clock" property="date"/>
+<li> Day: is <jsp:getProperty name="clock" property="day"/>
+<li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/>
+<li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/>
+<li> era: is <jsp:getProperty name="clock" property="era"/>
+<li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/>
+<li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/>
</ul>
</font>
diff --git a/tomcat-cas/webapps/examples/jsp/error/err.jsp b/tomcat-cas/webapps/examples/jsp/error/err.jsp
index 08030b0..956da8e 100644
--- a/tomcat-cas/webapps/examples/jsp/error/err.jsp
+++ b/tomcat-cas/webapps/examples/jsp/error/err.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,31 +13,32 @@
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>
<body bgcolor="lightblue">
- <%@ page errorPage="errorpge.jsp" %>
- <jsp:useBean id="foo" scope="request" class="error.Smart" />
- <%
- String name = null;
+ <%@ page errorPage="errorpge.jsp" %>
+ <jsp:useBean id="foo" scope="request" class="error.Smart" />
+ <%
+ String name = null;
- if (request.getParameter("name") == null) {
- %>
- <%@ include file="error.html" %>
- <%
- } else {
- foo.setName(request.getParameter("name"));
- if (foo.getName().equalsIgnoreCase("integra"))
- name = "acura";
- if (name.equalsIgnoreCase("acura")) {
- %>
+ if (request.getParameter("name") == null) {
+ %>
+ <%@ include file="error.html" %>
+ <%
+ } else {
+ foo.setName(request.getParameter("name"));
+ if (foo.getName().equalsIgnoreCase("integra"))
+ name = "acura";
+ if (name.equalsIgnoreCase("acura")) {
+ %>
- <H1> Yes!!! <a href="http://www.acura.com">Acura</a> is my favorite car.
+ <H1> Yes!!! <a href="http://www.acura.com">Acura</a> is my favorite car.
- <%
- }
- }
- %>
+ <%
+ }
+ }
+ %>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/error/err.jsp.html b/tomcat-cas/webapps/examples/jsp/error/err.jsp.html
index 65b5654..8f0727d 100644
--- a/tomcat-cas/webapps/examples/jsp/error/err.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/error/err.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,31 +14,32 @@
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>
<body bgcolor="lightblue">
- <%@ page errorPage="errorpge.jsp" %>
- <jsp:useBean id="foo" scope="request" class="error.Smart" />
- <%
- String name = null;
+ <%@ page errorPage="errorpge.jsp" %>
+ <jsp:useBean id="foo" scope="request" class="error.Smart" />
+ <%
+ String name = null;
- if (request.getParameter("name") == null) {
- %>
- <%@ include file="error.html" %>
- <%
- } else {
- foo.setName(request.getParameter("name"));
- if (foo.getName().equalsIgnoreCase("integra"))
- name = "acura";
- if (name.equalsIgnoreCase("acura")) {
- %>
+ if (request.getParameter("name") == null) {
+ %>
+ <%@ include file="error.html" %>
+ <%
+ } else {
+ foo.setName(request.getParameter("name"));
+ if (foo.getName().equalsIgnoreCase("integra"))
+ name = "acura";
+ if (name.equalsIgnoreCase("acura")) {
+ %>
- <H1> Yes!!! <a href="http://www.acura.com">Acura</a> is my favorite car.
+ <H1> Yes!!! <a href="http://www.acura.com">Acura</a> is my favorite car.
- <%
- }
- }
- %>
+ <%
+ }
+ }
+ %>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp b/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp
index 113c204..dda6fbd 100644
--- a/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp
+++ b/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,12 +13,13 @@
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>
<body bgcolor="red">
- <%@ page isErrorPage="true" %>
- <h1> The exception <%= exception.getMessage() %> tells me you
- made a wrong choice.
+ <%@ page isErrorPage="true" %>
+ <h1> The exception <%= exception.getMessage() %> tells me you
+ made a wrong choice.
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp.html b/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp.html
index 69bf244..cfb6fcf 100644
--- a/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/error/errorpge.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,13 +14,14 @@
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>
<body bgcolor="red">
- <%@ page isErrorPage="true" %>
- <h1> The exception <%= exception.getMessage() %> tells me you
- made a wrong choice.
+ <%@ page isErrorPage="true" %>
+ <h1> The exception <%= exception.getMessage() %> tells me you
+ made a wrong choice.
</body>
</html>
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/forward/forward.jsp b/tomcat-cas/webapps/examples/jsp/forward/forward.jsp
index 8e2ceab..4ee56a2 100644
--- a/tomcat-cas/webapps/examples/jsp/forward/forward.jsp
+++ b/tomcat-cas/webapps/examples/jsp/forward/forward.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,13 +13,13 @@
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>
+<%
double freeMem = Runtime.getRuntime().freeMemory();
double totlMem = Runtime.getRuntime().totalMemory();
double percent = freeMem/totlMem;
- if (percent < 0.5) {
+ if (percent < 0.5) {
%>
<jsp:forward page="one.jsp"/>
diff --git a/tomcat-cas/webapps/examples/jsp/forward/forward.jsp.html b/tomcat-cas/webapps/examples/jsp/forward/forward.jsp.html
index 9f0a563..904ea8a 100644
--- a/tomcat-cas/webapps/examples/jsp/forward/forward.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/forward/forward.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,13 +14,13 @@
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>
+<%
double freeMem = Runtime.getRuntime().freeMemory();
double totlMem = Runtime.getRuntime().totalMemory();
double percent = freeMem/totlMem;
- if (percent < 0.5) {
+ if (percent < 0.5) {
%>
<jsp:forward page="one.jsp"/>
diff --git a/tomcat-cas/webapps/examples/jsp/forward/one.jsp b/tomcat-cas/webapps/examples/jsp/forward/one.jsp
index 90297b7..41cb8b8 100644
--- a/tomcat-cas/webapps/examples/jsp/forward/one.jsp
+++ b/tomcat-cas/webapps/examples/jsp/forward/one.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,10 +13,11 @@
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>
<body bgcolor="white">
<font color="red">
-VM Memory usage < 50%.
+VM Memory usage < 50%.
</html>
\ No newline at end of file
diff --git a/tomcat-cas/webapps/examples/jsp/forward/one.jsp.html b/tomcat-cas/webapps/examples/jsp/forward/one.jsp.html
index 7cb77a0..2d6d4e4 100644
--- a/tomcat-cas/webapps/examples/jsp/forward/one.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/forward/one.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,11 +14,12 @@
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>
<body bgcolor="white">
<font color="red">
-VM Memory usage < 50%.
+VM Memory usage &lt; 50%.
</html>
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/forward/two.html b/tomcat-cas/webapps/examples/jsp/forward/two.html
index 4bc9402..b6ea4f9 100644
--- a/tomcat-cas/webapps/examples/jsp/forward/two.html
+++ b/tomcat-cas/webapps/examples/jsp/forward/two.html
@@ -19,5 +19,5 @@
<body bgcolor="white">
<font color="red">
-VM Memory usage > 50%.
+VM Memory usage > 50%.
</html>
\ No newline at end of file
diff --git a/tomcat-cas/webapps/examples/jsp/include/foo.jsp b/tomcat-cas/webapps/examples/jsp/include/foo.jsp
index ce4101b..f909fa3 100644
--- a/tomcat-cas/webapps/examples/jsp/include/foo.jsp
+++ b/tomcat-cas/webapps/examples/jsp/include/foo.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,9 +13,5 @@
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.
--->
-<body bgcolor="white">
-<font color="red">
-
-<%= System.currentTimeMillis() %>
+--%><%= System.currentTimeMillis() %>
diff --git a/tomcat-cas/webapps/examples/jsp/include/foo.jsp.html b/tomcat-cas/webapps/examples/jsp/include/foo.jsp.html
index 638d41d..4bbaeb3 100644
--- a/tomcat-cas/webapps/examples/jsp/include/foo.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/include/foo.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,10 +14,6 @@
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.
--->
-<body bgcolor="white">
-<font color="red">
-
-<%= System.currentTimeMillis() %>
+--%><%= System.currentTimeMillis() %>
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/include/include.jsp b/tomcat-cas/webapps/examples/jsp/include/include.jsp
index 34fd6c3..92655d1 100644
--- a/tomcat-cas/webapps/examples/jsp/include/include.jsp
+++ b/tomcat-cas/webapps/examples/jsp/include/include.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,7 +13,8 @@
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>
<body bgcolor="white">
@@ -22,14 +22,9 @@
<%@ page buffer="5kb" autoFlush="false" %>
-<p>In place evaluation of another JSP which gives you the current time:
+<p>In place evaluation of another JSP which gives you the current time: <%@ include file="foo.jsp" %>
-<%@ include file="foo.jsp" %>
-
-<p> <jsp:include page="foo.html" flush="true"/> by including the output of another JSP:
-
-<jsp:include page="foo.jsp" flush="true"/>
-
-:-)
+<p> <jsp:include page="foo.html" flush="true"/> by including the output of another JSP: <jsp:include page="foo.jsp" flush="true"/>
+:-)
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/include/include.jsp.html b/tomcat-cas/webapps/examples/jsp/include/include.jsp.html
index f45c300..035b57a 100644
--- a/tomcat-cas/webapps/examples/jsp/include/include.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/include/include.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,7 +14,8 @@
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>
<body bgcolor="white">
@@ -23,15 +23,10 @@
<%@ page buffer="5kb" autoFlush="false" %>
-<p>In place evaluation of another JSP which gives you the current time:
+<p>In place evaluation of another JSP which gives you the current time: <%@ include file="foo.jsp" %>
-<%@ include file="foo.jsp" %>
-
-<p> <jsp:include page="foo.html" flush="true"/> by including the output of another JSP:
-
-<jsp:include page="foo.jsp" flush="true"/>
-
-:-)
+<p> <jsp:include page="foo.html" flush="true"/> by including the output of another JSP: <jsp:include page="foo.jsp" flush="true"/>
+:-)
</html>
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/index.html b/tomcat-cas/webapps/examples/jsp/index.html
index c41acf2..c6b1c43 100644
--- a/tomcat-cas/webapps/examples/jsp/index.html
+++ b/tomcat-cas/webapps/examples/jsp/index.html
@@ -103,6 +103,14 @@
</tr>
<tr valign=TOP>
+<td>Composite Expressions</td>
+<td valign=TOP width="30%"><a href="jsp2/el/composite.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/el/composite.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/el/composite.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/el/composite.html">Source</a></td>
+</tr>
+
+
+<tr valign=TOP>
<td><br><b>SimpleTag Handlers and JSP Fragments</b></td>
</tr>
@@ -327,7 +335,7 @@
<tr VALIGN=TOP>
<td>If </td>
<td VALIGN=TOP WIDTH="30%">
- <a href="tagplugin/if.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0
+ <a href="tagplugin/if.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0
align=TOP></a>
<a href="tagplugin/if.jsp">Execute</a>
</td>
@@ -341,7 +349,7 @@
<tr VALIGN=TOP>
<td>ForEach </td>
<td VALIGN=TOP WIDTH="30%">
- <a href="tagplugin/foreach.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0
+ <a href="tagplugin/foreach.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0
align=TOP></a>
<a href="tagplugin/foreach.jsp">Execute</a>
</td>
@@ -366,5 +374,24 @@
</table>
+<br/>
+<b><u><font size="+1">Other Examples</font></u></b><br>
+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
+
+<tr VALIGN=TOP>
+ <td>FORM Authentication </td>
+ <td VALIGN=TOP WIDTH="30%">
+ <a href="security/protected/index.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP> Execute</a>
+ </td>
+ <td WIDTH="30%"></td>
+</tr>
+<tr>
+ <td colspan="3">Example that demonstrates protecting a resource and
+ using Form-Based authentication. To access the page the user must
+ have role of either "tomcat" or "role1". By default no user
+ is configured to have these roles.</td>
+</tr>
+
+</table>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/Functions.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/Functions.java.html
index 350fce6..91abc75 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/Functions.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/Functions.java.html
@@ -17,29 +17,31 @@
*/
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 StringBuffer( text ).reverse().toString();
+ return new StringBuilder( text ).reverse().toString();
}
public static int numVowels( String text ) {
String vowels = "aeiouAEIOU";
- int result = 0;
+ int result = 0;
for( int i = 0; i < text.length(); i++ ) {
- if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
- result++;
- }
- }
- return result;
+ if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
+ result++;
+ }
+ }
+ return result;
}
public static String caps( String text ) {
- return text.toUpperCase();
+ return text.toUpperCase(Locale.ENGLISH);
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/ValuesBean.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/ValuesBean.java.html
new file mode 100644
index 0000000..beadf72
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/ValuesBean.java.html
@@ -0,0 +1,54 @@
+<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;
+
+/**
+ * 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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/ValuesTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/ValuesTag.java.html
new file mode 100644
index 0000000..16f62ab
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/ValuesTag.java.html
@@ -0,0 +1,81 @@
+<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 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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp
index e2ec74c..a3b3e7a 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>
@@ -22,7 +22,7 @@
<h1>JSP 2.0 Expression Language - Basic Arithmetic</h1>
<hr>
This example illustrates basic Expression Language arithmetic.
- Addition (+), subtraction (-), multiplication (*), division (/ or div),
+ Addition (+), subtraction (-), multiplication (*), division (/ or div),
and modulus (% or mod) are all supported. Error conditions, like
division by zero, are handled gracefully.
<br>
@@ -30,58 +30,58 @@
<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>
+ <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>
+ </table>
</code>
</blockquote>
</body>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html
index 4aa05c8..e703cde 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>
@@ -23,7 +23,7 @@
<h1>JSP 2.0 Expression Language - Basic Arithmetic</h1>
<hr>
This example illustrates basic Expression Language arithmetic.
- Addition (+), subtraction (-), multiplication (*), division (/ or div),
+ Addition (+), subtraction (-), multiplication (*), division (/ or div),
and modulus (% or mod) are all supported. Error conditions, like
division by zero, are handled gracefully.
<br>
@@ -31,58 +31,58 @@
<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>
+ <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>
+ </table>
</code>
</blockquote>
</body>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp
index e01188a..ce63d5a 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>
@@ -36,80 +36,80 @@
<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>
+ <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>
+ <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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html
index efc4da3..c5db858 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>
@@ -37,80 +37,80 @@
<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>
+ <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>
+ <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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.html
new file mode 100644
index 0000000..b8bfa0e
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.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="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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.jsp
new file mode 100644
index 0000000..c6fa113
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.jsp
@@ -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>
+
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.jsp.html
new file mode 100644
index 0000000..1d0014f
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/composite.jsp.html
@@ -0,0 +1,112 @@
+<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.
+--%>
+<%@ 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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp
index 66478c0..90895aa 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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://tomcat.apache.org/jsp2-example-taglib"%>
@@ -26,39 +26,39 @@
<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
+ 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"])}">
+ 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>
+ <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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp.html
index 9ac0c79..ecb761b 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/functions.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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://tomcat.apache.org/jsp2-example-taglib"%>
@@ -27,39 +27,39 @@
<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
+ 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"])}">
+ 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>
+ <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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp
index 8d6841a..999ad13 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>
@@ -23,28 +23,28 @@
<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
+ 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
+ <li>pageScope - a Map that maps page-scoped attribute names to
their values</li>
- <li>requestScope - a Map that maps request-scoped attribute names
+ <li>requestScope - a Map that maps request-scoped attribute names
to their values</li>
- <li>sessionScope - a Map that maps session-scoped attribute names
+ <li>sessionScope - a Map that maps session-scoped attribute names
to their values</li>
- <li>applicationScope - a Map that maps application-scoped attribute
+ <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
+ <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
+ <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
+ <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
+ <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
+ <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>
@@ -52,37 +52,37 @@
<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"])}">
+ 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>
+ <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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html
index a2d9bdc..a036a07 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>
@@ -24,28 +24,28 @@
<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
+ 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
+ <li>pageScope - a Map that maps page-scoped attribute names to
their values</li>
- <li>requestScope - a Map that maps request-scoped attribute names
+ <li>requestScope - a Map that maps request-scoped attribute names
to their values</li>
- <li>sessionScope - a Map that maps session-scoped attribute names
+ <li>sessionScope - a Map that maps session-scoped attribute names
to their values</li>
- <li>applicationScope - a Map that maps application-scoped attribute
+ <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
+ <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
+ <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
+ <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
+ <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
+ <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>
@@ -53,37 +53,37 @@
<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"])}">
+ 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>
+ <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>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html
index 0b15181..2711b30 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html
@@ -21,18 +21,18 @@
public class FooBean {
private String bar;
-
+
public FooBean() {
bar = "Initial value";
}
-
+
public String getBar() {
return this.bar;
}
-
+
public void setBar(String bar) {
this.bar = bar;
}
-
+
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html
index c409839..6fb9b0d 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html
@@ -19,16 +19,18 @@
package jsp2.examples.simpletag;
+import java.io.IOException;
+
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
-import java.io.IOException;
/**
* SimpleTag handler that prints "Hello, world!"
*/
public class HelloWorldSimpleTag extends SimpleTagSupport {
+ @Override
public void doTag() throws JspException, IOException {
- getJspContext().getOut().write( "Hello, world!" );
+ getJspContext().getOut().write( "Hello, world!" );
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html
index 1b66d06..806cf7b 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html
@@ -19,22 +19,28 @@
package jsp2.examples.simpletag;
+import java.io.IOException;
+import java.util.Random;
+
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.JspFragment;
import javax.servlet.jsp.tagext.SimpleTagSupport;
-import java.io.IOException;
/**
* SimpleTag handler that accepts takes three attributes of type
* JspFragment and invokes then in a random order.
*/
public class ShuffleSimpleTag extends SimpleTagSupport {
+ // No need for this to use SecureRandom
+ private static Random random = new Random();
+
private JspFragment fragment1;
private JspFragment fragment2;
private JspFragment fragment3;
+ @Override
public void doTag() throws JspException, IOException {
- switch( (int)(Math.random() * 6) ) {
+ switch(random.nextInt(6)) {
case 0:
fragment1.invoke( null );
fragment2.invoke( null );
@@ -71,11 +77,11 @@
public void setFragment1( JspFragment fragment1 ) {
this.fragment1 = fragment1;
}
-
+
public void setFragment2( JspFragment fragment2 ) {
this.fragment2 = fragment2;
}
-
+
public void setFragment3( JspFragment fragment3 ) {
this.fragment3 = fragment3;
}
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html
index 4453222..2cd454b 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html
@@ -19,9 +19,10 @@
package jsp2.examples.simpletag;
+import java.io.IOException;
+
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
-import java.io.IOException;
/**
* Displays a tile as a single cell in a table.
@@ -30,17 +31,18 @@
private String color;
private String label;
+ @Override
public void doTag() throws JspException, IOException {
- getJspContext().getOut().write(
- "<td width=\"32\" height=\"32\" bgcolor=\"" + this.color +
- "\"><font color=\"#ffffff\"><center>" + this.label +
+ getJspContext().getOut().write(
+ "<td width=\"32\" height=\"32\" bgcolor=\"" + this.color +
+ "\"><font color=\"#ffffff\"><center>" + this.label +
"</center></font></td>" );
}
public void setColor( String color ) {
this.color = color;
}
-
+
public void setLabel( String label ) {
this.label = label;
}
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp
index 64b6d6e..02abbd1 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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/jsp2-example-taglib"%>
<html>
@@ -23,7 +23,7 @@
<body>
<h1>JSP 2.0 Examples - jsp:attribute and jsp:body</h1>
<hr>
- <p>The new <jsp:attribute> and <jsp:body>
+ <p>The new <jsp:attribute> and <jsp:body>
standard actions can be used to specify the value of any standard
action or custom action attribute.</p>
<p>This example uses the <jsp:attribute>
@@ -36,7 +36,7 @@
Bean created! Setting foo.bar...<br>
<jsp:setProperty name="foo" property="bar">
<jsp:attribute name="value">
- <my:helloWorld/>
+ <my:helloWorld/>
</jsp:attribute>
</jsp:setProperty>
</jsp:useBean>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html
index eb3a927..088ed20 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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/jsp2-example-taglib"%>
<html>
@@ -24,7 +24,7 @@
<body>
<h1>JSP 2.0 Examples - jsp:attribute and jsp:body</h1>
<hr>
- <p>The new &lt;jsp:attribute&gt; and &lt;jsp:body&gt;
+ <p>The new &lt;jsp:attribute&gt; and &lt;jsp:body&gt;
standard actions can be used to specify the value of any standard
action or custom action attribute.</p>
<p>This example uses the &lt;jsp:attribute&gt;
@@ -37,7 +37,7 @@
Bean created! Setting foo.bar...<br>
<jsp:setProperty name="foo" property="bar">
<jsp:attribute name="value">
- <my:helloWorld/>
+ <my:helloWorld/>
</jsp:attribute>
</jsp:setProperty>
</jsp:useBean>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp
index 2a318a7..424af35 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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/jsp2-example-taglib"%>
<html>
@@ -25,10 +25,10 @@
<hr>
<p>Try reloading the page a few times. Both the rows and the columns
are shuffled and appear different each time.</p>
- <p>Here's how the code works. The SimpleTag handler called
- <my:shuffle> accepts three attributes. Each attribute is a
+ <p>Here's how the code works. The SimpleTag handler called
+ <my:shuffle> accepts three attributes. Each attribute is a
JSP Fragment, meaning it is a fragment of JSP code that can be
- dynamically executed by the shuffle tag handler on demand. The
+ dynamically executed by the shuffle tag handler on demand. The
shuffle tag handler executes the three fragments in a random order.
To shuffle both the rows and the columns, the shuffle tag is used
with itself as a parameter.</p>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html
index 9329285..231eba6 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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/jsp2-example-taglib"%>
<html>
@@ -26,10 +26,10 @@
<hr>
<p>Try reloading the page a few times. Both the rows and the columns
are shuffled and appear different each time.</p>
- <p>Here's how the code works. The SimpleTag handler called
- &lt;my:shuffle&gt; accepts three attributes. Each attribute is a
+ <p>Here's how the code works. The SimpleTag handler called
+ &lt;my:shuffle&gt; accepts three attributes. Each attribute is a
JSP Fragment, meaning it is a fragment of JSP code that can be
- dynamically executed by the shuffle tag handler on demand. The
+ dynamically executed by the shuffle tag handler on demand. The
shuffle tag handler executes the three fragments in a random order.
To shuffle both the rows and the columns, the shuffle tag is used
with itself as a parameter.</p>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx
index 8a5b27d..ba53d8d 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx
@@ -17,7 +17,7 @@
<tags:xhtmlbasic xmlns:tags="urn:jsptagdir:/WEB-INF/tags"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
- xmlns="http://www.w3.org/1999/xhtml">
+ xmlns="http://www.w3.org/1999/xhtml">
<jsp:directive.page contentType="text/html" />
<head>
<title>JSPX - XHTML Basic Example</title>
@@ -26,7 +26,7 @@
<h1>JSPX - XHTML Basic Example</h1>
<hr/>
This example illustrates how to use JSPX to produce an XHTML basic
- document suitable for use with mobile phones, televisions,
+ document suitable for use with mobile phones, televisions,
PDAs, vending machines, pagers, car navigation systems,
mobile game machines, digital book readers, smart watches, etc.
<p/>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx.html
index f177334..2116538 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/basic.jspx.html
@@ -18,7 +18,7 @@
<tags:xhtmlbasic xmlns:tags="urn:jsptagdir:/WEB-INF/tags"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
- xmlns="http://www.w3.org/1999/xhtml">
+ xmlns="http://www.w3.org/1999/xhtml">
<jsp:directive.page contentType="text/html" />
<head>
<title>JSPX - XHTML Basic Example</title>
@@ -27,7 +27,7 @@
<h1>JSPX - XHTML Basic Example</h1>
<hr/>
This example illustrates how to use JSPX to produce an XHTML basic
- document suitable for use with mobile phones, televisions,
+ document suitable for use with mobile phones, televisions,
PDAs, vending machines, pagers, car navigation systems,
mobile game machines, digital book readers, smart watches, etc.
<p/>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/svgexample.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/svgexample.html
index 12bcd82..6ef1b44 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/svgexample.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/svgexample.html
@@ -23,7 +23,7 @@
<hr>
This example uses JSP 2.0's new, simplified JSPX syntax to render a
Scalable Vector Graphics (SVG) document. When you view the source,
- notice the lack of a <jsp:root> element! The text to be rendered
+ notice the lack of a <jsp:root> element! The text to be rendered
can be modified by changing the value of the name parameter.
<p>
SVG has many potential uses, such as searchable images, or images
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx
index ad97af2..2ade5d1 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!--
+<!--
- This example is based off the textRotate.svg example that comes
- with Apache Batik. The original example was written by Bill Haneman.
- This version by Mark Roth.
@@ -38,14 +38,14 @@
<jsp:text>
<![CDATA[<g opacity="0.95" transform="scale(1.05) rotate(15)">]]>
</jsp:text>
- <text x="0" y="0" transform="scale(1.6, 1.6)" fill="DarkSlateBlue"
- text-anchor="middle" font-size="40" font-family="Serif"
+ <text x="0" y="0" transform="scale(1.6, 1.6)" fill="DarkSlateBlue"
+ text-anchor="middle" font-size="40" font-family="Serif"
id="words">${name}</text>
</c:forEach>
<c:forEach var="i" begin="1" end="24">
<jsp:text><![CDATA[</g>]]></jsp:text>
</c:forEach>
- <text style="font-size:75;font-family:Serif;fill:white"
+ <text style="font-size:75;font-family:Serif;fill:white"
text-anchor="middle">${name}</text>
</g>
</g>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx.html b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx.html
index 5846a19..0313838 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/jspx/textRotate.jspx.html
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!--
+<!--
- This example is based off the textRotate.svg example that comes
- with Apache Batik. The original example was written by Bill Haneman.
- This version by Mark Roth.
@@ -39,14 +39,14 @@
<jsp:text>
<![CDATA[<g opacity="0.95" transform="scale(1.05) rotate(15)">]]>
</jsp:text>
- <text x="0" y="0" transform="scale(1.6, 1.6)" fill="DarkSlateBlue"
- text-anchor="middle" font-size="40" font-family="Serif"
+ <text x="0" y="0" transform="scale(1.6, 1.6)" fill="DarkSlateBlue"
+ text-anchor="middle" font-size="40" font-family="Serif"
id="words">${name}</text>
</c:forEach>
<c:forEach var="i" begin="1" end="24">
<jsp:text><![CDATA[</g>]]></jsp:text>
</c:forEach>
- <text style="font-size:75;font-family:Serif;fill:white"
+ <text style="font-size:75;font-family:Serif;fill:white"
text-anchor="middle">${name}</text>
</g>
</g>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/misc/EchoAttributesTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/misc/EchoAttributesTag.java.html
index 4e62250..9b25ba0 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/misc/EchoAttributesTag.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/misc/EchoAttributesTag.java.html
@@ -19,38 +19,41 @@
package jsp2.examples.simpletag;
+import java.io.IOException;
+import java.util.ArrayList;
+
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.tagext.SimpleTagSupport;
import javax.servlet.jsp.tagext.DynamicAttributes;
-import java.util.ArrayList;
-import java.io.IOException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
- * SimpleTag handler that echoes all its attributes
+ * SimpleTag handler that echoes all its attributes
*/
-public class EchoAttributesTag
+public class EchoAttributesTag
extends SimpleTagSupport
implements DynamicAttributes
{
- private ArrayList keys = new ArrayList();
- private ArrayList values = new ArrayList();
+ private ArrayList<String> keys = new ArrayList<String>();
+ private ArrayList<Object> values = new ArrayList<Object>();
+ @Override
public void doTag() throws JspException, IOException {
- JspWriter out = getJspContext().getOut();
- for( int i = 0; i < keys.size(); i++ ) {
- String key = (String)keys.get( i );
- Object value = values.get( i );
- out.println( "<li>" + key + " = " + value + "</li>" );
+ JspWriter out = getJspContext().getOut();
+ for( int i = 0; i < keys.size(); i++ ) {
+ String key = keys.get( i );
+ Object value = values.get( i );
+ out.println( "<li>" + key + " = " + value + "</li>" );
}
}
- public void setDynamicAttribute( String uri, String localName,
- Object value )
- throws JspException
+ @Override
+ public void setDynamicAttribute( String uri, String localName,
+ Object value )
+ throws JspException
{
- keys.add( localName );
- values.add( value );
+ keys.add( localName );
+ values.add( value );
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp
index 7ccf481..51608c7 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,18 +13,18 @@
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/jsp2-example-taglib"%>
<h1>JSP 2.0 Examples - JSP Configuration</h1>
<hr>
- <p>Using a <jsp-property-group> element in the web.xml
+ <p>Using a <jsp-property-group> element in the web.xml
deployment descriptor, this JSP page has been configured in the
following ways:</p>
<ul>
<li>Uses <include-prelude> to include the top banner.</li>
<li>Uses <include-coda> to include the bottom banner.</li>
- <li>Uses <scripting-invalid> true to disable
- <% scripting %> elements</li>
+ <li>Uses <scripting-invalid> true to disable
+ <% scripting %> elements</li>
<li>Uses <el-ignored> true to disable ${EL} elements</li>
<li>Uses <page-encoding> ISO-8859-1 to set the page encoding (though this is the default anyway)</li>
</ul>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp.html
index 033f2d2..dbfc450 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/misc/config.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,18 +14,18 @@
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/jsp2-example-taglib"%>
<h1>JSP 2.0 Examples - JSP Configuration</h1>
<hr>
- <p>Using a &lt;jsp-property-group&gt; element in the web.xml
+ <p>Using a &lt;jsp-property-group&gt; element in the web.xml
deployment descriptor, this JSP page has been configured in the
following ways:</p>
<ul>
<li>Uses &lt;include-prelude&gt; to include the top banner.</li>
<li>Uses &lt;include-coda&gt; to include the bottom banner.</li>
- <li>Uses &lt;scripting-invalid&gt; true to disable
- &lt;% scripting %&gt; elements</li>
+ <li>Uses &lt;scripting-invalid&gt; true to disable
+ &lt;% scripting %&gt; elements</li>
<li>Uses &lt;el-ignored&gt; true to disable ${EL} elements</li>
<li>Uses &lt;page-encoding&gt; ISO-8859-1 to set the page encoding (though this is the default anyway)</li>
</ul>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp
index 637dea9..b351741 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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/jsp2-example-taglib"%>
<html>
<head>
@@ -22,7 +22,7 @@
<body>
<h1>JSP 2.0 Examples - Dynamic Attributes</h1>
<hr>
- <p>This JSP page invokes a custom tag that accepts a dynamic set
+ <p>This JSP page invokes a custom tag that accepts a dynamic set
of attributes. The tag echoes the name and value of all attributes
passed to it.</p>
<hr>
@@ -36,9 +36,9 @@
</ul>
<h2>Invocation 3 (three attributes)</h2>
<ul>
- <my:echoAttributes dogName="Scruffy"
- catName="Fluffy"
- blowfishName="Puffy"/>
+ <my:echoAttributes dogName="Scruffy"
+ catName="Fluffy"
+ blowfishName="Puffy"/>
</ul>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp.html
index ec47c8c..1179f82 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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/jsp2-example-taglib"%>
<html>
<head>
@@ -23,7 +23,7 @@
<body>
<h1>JSP 2.0 Examples - Dynamic Attributes</h1>
<hr>
- <p>This JSP page invokes a custom tag that accepts a dynamic set
+ <p>This JSP page invokes a custom tag that accepts a dynamic set
of attributes. The tag echoes the name and value of all attributes
passed to it.</p>
<hr>
@@ -37,9 +37,9 @@
</ul>
<h2>Invocation 3 (three attributes)</h2>
<ul>
- <my:echoAttributes dogName="Scruffy"
- catName="Fluffy"
- blowfishName="Puffy"/>
+ <my:echoAttributes dogName="Scruffy"
+ catName="Fluffy"
+ blowfishName="Puffy"/>
</ul>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/BookBean.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/BookBean.java.html
index a977a8c..143d754 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/BookBean.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/BookBean.java.html
@@ -23,7 +23,7 @@
private String title;
private String author;
private String isbn;
-
+
public BookBean( String title, String author, String isbn ) {
this.title = title;
this.author = author;
@@ -33,14 +33,14 @@
public String getTitle() {
return this.title;
}
-
+
public String getAuthor() {
return this.author;
}
-
+
public String getIsbn() {
return this.isbn;
}
-
+
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/FindBookSimpleTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/FindBookSimpleTag.java.html
index d010f0a..246df1f 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/FindBookSimpleTag.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/FindBookSimpleTag.java.html
@@ -21,6 +21,7 @@
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
+
import jsp2.examples.BookBean;
/**
@@ -29,18 +30,19 @@
*/
public class FindBookSimpleTag extends SimpleTagSupport {
private String var;
-
+
private static final String BOOK_TITLE = "The Lord of the Rings";
private static final String BOOK_AUTHOR = "J. R. R. Tolkein";
private static final String BOOK_ISBN = "0618002251";
+ @Override
public void doTag() throws JspException {
BookBean book = new BookBean( BOOK_TITLE, BOOK_AUTHOR, BOOK_ISBN );
getJspContext().setAttribute( this.var, book );
}
public void setVar( String var ) {
- this.var = var;
+ this.var = var;
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/Functions.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/Functions.java.html
index 350fce6..91abc75 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/Functions.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/Functions.java.html
@@ -17,29 +17,31 @@
*/
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 StringBuffer( text ).reverse().toString();
+ return new StringBuilder( text ).reverse().toString();
}
public static int numVowels( String text ) {
String vowels = "aeiouAEIOU";
- int result = 0;
+ int result = 0;
for( int i = 0; i < text.length(); i++ ) {
- if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
- result++;
- }
- }
- return result;
+ if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
+ result++;
+ }
+ }
+ return result;
}
public static String caps( String text ) {
- return text.toUpperCase();
+ return text.toUpperCase(Locale.ENGLISH);
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/HelloWorldSimpleTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/HelloWorldSimpleTag.java.html
index c409839..6fb9b0d 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/HelloWorldSimpleTag.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/HelloWorldSimpleTag.java.html
@@ -19,16 +19,18 @@
package jsp2.examples.simpletag;
+import java.io.IOException;
+
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
-import java.io.IOException;
/**
* SimpleTag handler that prints "Hello, world!"
*/
public class HelloWorldSimpleTag extends SimpleTagSupport {
+ @Override
public void doTag() throws JspException, IOException {
- getJspContext().getOut().write( "Hello, world!" );
+ getJspContext().getOut().write( "Hello, world!" );
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/RepeatSimpleTag.java.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/RepeatSimpleTag.java.html
index 2ad96eb..852ac2a 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/RepeatSimpleTag.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/RepeatSimpleTag.java.html
@@ -19,26 +19,28 @@
package jsp2.examples.simpletag;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+
/**
- * SimpleTag handler that accepts a num attribute and
+ * SimpleTag handler that accepts a num attribute and
* invokes its body 'num' times.
*/
public class RepeatSimpleTag extends SimpleTagSupport {
private int num;
+ @Override
public void doTag() throws JspException, IOException {
for (int i=0; i<num; i++) {
getJspContext().setAttribute("count", String.valueOf( i + 1 ) );
- getJspBody().invoke(null);
+ getJspBody().invoke(null);
}
}
public void setNum(int num) {
- this.num = num;
+ this.num = num;
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp
index 7a9a064..069bd37 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
<html>
<head>
@@ -22,34 +22,34 @@
<body>
<h1>JSP 2.0 Examples - Book SimpleTag Handler</h1>
<hr>
- <p>Illustrates a semi-realistic use of SimpleTag and the Expression
- Language. First, a <my:findBook> tag is invoked to populate
- the page context with a BookBean. Then, the books fields are printed
+ <p>Illustrates a semi-realistic use of SimpleTag and the Expression
+ Language. First, a <my:findBook> tag is invoked to populate
+ the page context with a BookBean. Then, the books fields are printed
in all caps.</p>
<br>
<b><u>Result:</u></b><br>
<my:findBook var="book"/>
<table border="1">
<thead>
- <td><b>Field</b></td>
- <td><b>Value</b></td>
- <td><b>Capitalized</b></td>
- </thead>
- <tr>
- <td>Title</td>
- <td>${book.title}</td>
- <td>${my:caps(book.title)}</td>
- </tr>
- <tr>
- <td>Author</td>
- <td>${book.author}</td>
- <td>${my:caps(book.author)}</td>
- </tr>
- <tr>
- <td>ISBN</td>
- <td>${book.isbn}</td>
- <td>${my:caps(book.isbn)}</td>
- </tr>
+ <td><b>Field</b></td>
+ <td><b>Value</b></td>
+ <td><b>Capitalized</b></td>
+ </thead>
+ <tr>
+ <td>Title</td>
+ <td>${book.title}</td>
+ <td>${my:caps(book.title)}</td>
+ </tr>
+ <tr>
+ <td>Author</td>
+ <td>${book.author}</td>
+ <td>${my:caps(book.author)}</td>
+ </tr>
+ <tr>
+ <td>ISBN</td>
+ <td>${book.isbn}</td>
+ <td>${my:caps(book.isbn)}</td>
+ </tr>
</table>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp.html
index 7ecfe3b..4d242ab 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/book.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
<html>
<head>
@@ -23,34 +23,34 @@
<body>
<h1>JSP 2.0 Examples - Book SimpleTag Handler</h1>
<hr>
- <p>Illustrates a semi-realistic use of SimpleTag and the Expression
- Language. First, a &lt;my:findBook&gt; tag is invoked to populate
- the page context with a BookBean. Then, the books fields are printed
+ <p>Illustrates a semi-realistic use of SimpleTag and the Expression
+ Language. First, a &lt;my:findBook&gt; tag is invoked to populate
+ the page context with a BookBean. Then, the books fields are printed
in all caps.</p>
<br>
<b><u>Result:</u></b><br>
<my:findBook var="book"/>
<table border="1">
<thead>
- <td><b>Field</b></td>
- <td><b>Value</b></td>
- <td><b>Capitalized</b></td>
- </thead>
- <tr>
- <td>Title</td>
- <td>${book.title}</td>
- <td>${my:caps(book.title)}</td>
- </tr>
- <tr>
- <td>Author</td>
- <td>${book.author}</td>
- <td>${my:caps(book.author)}</td>
- </tr>
- <tr>
- <td>ISBN</td>
- <td>${book.isbn}</td>
- <td>${my:caps(book.isbn)}</td>
- </tr>
+ <td><b>Field</b></td>
+ <td><b>Value</b></td>
+ <td><b>Capitalized</b></td>
+ </thead>
+ <tr>
+ <td>Title</td>
+ <td>${book.title}</td>
+ <td>${my:caps(book.title)}</td>
+ </tr>
+ <tr>
+ <td>Author</td>
+ <td>${book.author}</td>
+ <td>${my:caps(book.author)}</td>
+ </tr>
+ <tr>
+ <td>ISBN</td>
+ <td>${book.isbn}</td>
+ <td>${my:caps(book.isbn)}</td>
+ </tr>
</table>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp
index 4222b2e..d5ebf98 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
<html>
<head>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp.html
index c363802..e43a05f 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/hello.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
<html>
<head>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp
index 1f3d008..f66bdde 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
<html>
<head>
@@ -23,11 +23,11 @@
<h1>JSP 2.0 Examples - Repeat SimpleTag Handler</h1>
<hr>
<p>This tag handler accepts a "num" parameter and repeats the body of the
- tag "num" times. It's a simple example, but the implementation of
- such a tag in JSP 2.0 is substantially simpler than the equivalent
+ tag "num" times. It's a simple example, but the implementation of
+ such a tag in JSP 2.0 is substantially simpler than the equivalent
JSP 1.2-style classic tag handler.</p>
<p>The body of the tag is encapsulated in a "JSP Fragment" and passed
- to the tag handler, which then executes it five times, inside a
+ to the tag handler, which then executes it five times, inside a
for loop. The tag handler passes in the current invocation in a
scoped variable called count, which can be accessed using the EL.</p>
<br>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp.html
index e36b66c..a3bd71e 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/simpletag/repeat.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
<html>
<head>
@@ -24,11 +24,11 @@
<h1>JSP 2.0 Examples - Repeat SimpleTag Handler</h1>
<hr>
<p>This tag handler accepts a "num" parameter and repeats the body of the
- tag "num" times. It's a simple example, but the implementation of
- such a tag in JSP 2.0 is substantially simpler than the equivalent
+ tag "num" times. It's a simple example, but the implementation of
+ such a tag in JSP 2.0 is substantially simpler than the equivalent
JSP 1.2-style classic tag handler.</p>
<p>The body of the tag is encapsulated in a "JSP Fragment" and passed
- to the tag handler, which then executes it five times, inside a
+ to the tag handler, which then executes it five times, inside a
for loop. The tag handler passes in the current invocation in a
scoped variable called count, which can be accessed using the EL.</p>
<br>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/displayProducts.tag.html b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/displayProducts.tag.html
index 6388336..7898fe2 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/displayProducts.tag.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/displayProducts.tag.html
@@ -25,28 +25,28 @@
<table border="1">
<tr>
- <td>
+ <td>
<c:set var="name" value="Hand-held Color PDA"/>
<c:set var="price" value="$298.86"/>
<jsp:invoke fragment="normalPrice"/>
</td>
- <td>
+ <td>
<c:set var="name" value="4-Pack 150 Watt Light Bulbs"/>
<c:set var="origPrice" value="$2.98"/>
<c:set var="salePrice" value="$2.32"/>
<jsp:invoke fragment="onSale"/>
</td>
- <td>
+ <td>
<c:set var="name" value="Digital Cellular Phone"/>
<c:set var="price" value="$68.74"/>
<jsp:invoke fragment="normalPrice"/>
</td>
- <td>
+ <td>
<c:set var="name" value="Baby Grand Piano"/>
<c:set var="price" value="$10,800.00"/>
<jsp:invoke fragment="normalPrice"/>
</td>
- <td>
+ <td>
<c:set var="name" value="Luxury Car w/ Leather Seats"/>
<c:set var="origPrice" value="$23,980.00"/>
<c:set var="salePrice" value="$21,070.00"/>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp
index e93c7c5..a5d9999 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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="tags" tagdir="/WEB-INF/tags" %>
<html>
<head>
@@ -22,7 +22,7 @@
<body>
<h1>JSP 2.0 Examples - Hello World Using a Tag File</h1>
<hr>
- <p>This JSP page invokes a custom tag that simply echos "Hello, World!"
+ <p>This JSP page invokes a custom tag that simply echos "Hello, World!"
The custom tag is generated from a tag file in the /WEB-INF/tags
directory.</p>
<p>Notice that we did not need to write a TLD for this tag. We just
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp.html
index c3b7b4f..4fbd217 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/hello.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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="tags" tagdir="/WEB-INF/tags" %>
<html>
<head>
@@ -23,7 +23,7 @@
<body>
<h1>JSP 2.0 Examples - Hello World Using a Tag File</h1>
<hr>
- <p>This JSP page invokes a custom tag that simply echos "Hello, World!"
+ <p>This JSP page invokes a custom tag that simply echos "Hello, World!"
The custom tag is generated from a tag file in the /WEB-INF/tags
directory.</p>
<p>Notice that we did not need to write a TLD for this tag. We just
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp
index 4dfc483..56f73b6 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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="tags" tagdir="/WEB-INF/tags" %>
<html>
<head>
@@ -22,8 +22,8 @@
<body>
<h1>JSP 2.0 Examples - Panels using Tag Files</h1>
<hr>
- <p>This JSP page invokes a custom tag that draws a
- panel around the contents of the tag body. Normally, such a tag
+ <p>This JSP page invokes a custom tag that draws a
+ panel around the contents of the tag body. Normally, such a tag
implementation would require a Java class with many println() statements,
outputting HTML. Instead, we can use a .tag file as a template,
and we don't need to write a single line of Java or even a TLD!</p>
@@ -32,25 +32,25 @@
<tr valign="top">
<td>
<tags:panel color="#ff8080" bgcolor="#ffc0c0" title="Panel 1">
- First panel.<br/>
- </tags:panel>
+ First panel.<br/>
+ </tags:panel>
</td>
<td>
<tags:panel color="#80ff80" bgcolor="#c0ffc0" title="Panel 2">
- Second panel.<br/>
- Second panel.<br/>
- Second panel.<br/>
- Second panel.<br/>
- </tags:panel>
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ </tags:panel>
</td>
<td>
<tags:panel color="#8080ff" bgcolor="#c0c0ff" title="Panel 3">
- Third panel.<br/>
+ Third panel.<br/>
<tags:panel color="#ff80ff" bgcolor="#ffc0ff" title="Inner">
- A panel in a panel.
- </tags:panel>
- Third panel.<br/>
- </tags:panel>
+ A panel in a panel.
+ </tags:panel>
+ Third panel.<br/>
+ </tags:panel>
</td>
</tr>
</table>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp.html
index 0cc746d..4a8277c 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/panel.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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="tags" tagdir="/WEB-INF/tags" %>
<html>
<head>
@@ -23,8 +23,8 @@
<body>
<h1>JSP 2.0 Examples - Panels using Tag Files</h1>
<hr>
- <p>This JSP page invokes a custom tag that draws a
- panel around the contents of the tag body. Normally, such a tag
+ <p>This JSP page invokes a custom tag that draws a
+ panel around the contents of the tag body. Normally, such a tag
implementation would require a Java class with many println() statements,
outputting HTML. Instead, we can use a .tag file as a template,
and we don't need to write a single line of Java or even a TLD!</p>
@@ -33,25 +33,25 @@
<tr valign="top">
<td>
<tags:panel color="#ff8080" bgcolor="#ffc0c0" title="Panel 1">
- First panel.<br/>
- </tags:panel>
+ First panel.<br/>
+ </tags:panel>
</td>
<td>
<tags:panel color="#80ff80" bgcolor="#c0ffc0" title="Panel 2">
- Second panel.<br/>
- Second panel.<br/>
- Second panel.<br/>
- Second panel.<br/>
- </tags:panel>
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ </tags:panel>
</td>
<td>
<tags:panel color="#8080ff" bgcolor="#c0c0ff" title="Panel 3">
- Third panel.<br/>
+ Third panel.<br/>
<tags:panel color="#ff80ff" bgcolor="#ffc0ff" title="Inner">
- A panel in a panel.
- </tags:panel>
- Third panel.<br/>
- </tags:panel>
+ A panel in a panel.
+ </tags:panel>
+ Third panel.<br/>
+ </tags:panel>
</td>
</tr>
</table>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp
index 328cc96..23b84f1 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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="tags" tagdir="/WEB-INF/tags" %>
<html>
<head>
@@ -22,7 +22,7 @@
<body>
<h1>JSP 2.0 Examples - Display Products Tag File</h1>
<hr>
- <p>This JSP page invokes a tag file that displays a listing of
+ <p>This JSP page invokes a tag file that displays a listing of
products. The custom tag accepts two fragments that enable
customization of appearance. One for when the product is on sale
and one for normal price.</p>
@@ -31,23 +31,23 @@
<h2>Products</h2>
<tags:displayProducts>
<jsp:attribute name="normalPrice">
- Item: ${name}<br/>
- Price: ${price}
+ Item: ${name}<br/>
+ Price: ${price}
</jsp:attribute>
<jsp:attribute name="onSale">
- Item: ${name}<br/>
- <font color="red"><strike>Was: ${origPrice}</strike></font><br/>
- <b>Now: ${salePrice}</b>
+ Item: ${name}<br/>
+ <font color="red"><strike>Was: ${origPrice}</strike></font><br/>
+ <b>Now: ${salePrice}</b>
</jsp:attribute>
</tags:displayProducts>
<hr>
<h2>Products (Same tag, alternate style)</h2>
<tags:displayProducts>
<jsp:attribute name="normalPrice">
- <b>${name}</b> @ ${price} ea.
+ <b>${name}</b> @ ${price} ea.
</jsp:attribute>
<jsp:attribute name="onSale">
- <b>${name}</b> @ ${salePrice} ea. (was: ${origPrice})
+ <b>${name}</b> @ ${salePrice} ea. (was: ${origPrice})
</jsp:attribute>
</tags:displayProducts>
</body>
diff --git a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp.html b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp.html
index f9b6e6f..a081b23 100644
--- a/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsp2/tagfiles/products.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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="tags" tagdir="/WEB-INF/tags" %>
<html>
<head>
@@ -23,7 +23,7 @@
<body>
<h1>JSP 2.0 Examples - Display Products Tag File</h1>
<hr>
- <p>This JSP page invokes a tag file that displays a listing of
+ <p>This JSP page invokes a tag file that displays a listing of
products. The custom tag accepts two fragments that enable
customization of appearance. One for when the product is on sale
and one for normal price.</p>
@@ -32,23 +32,23 @@
<h2>Products</h2>
<tags:displayProducts>
<jsp:attribute name="normalPrice">
- Item: ${name}<br/>
- Price: ${price}
+ Item: ${name}<br/>
+ Price: ${price}
</jsp:attribute>
<jsp:attribute name="onSale">
- Item: ${name}<br/>
- <font color="red"><strike>Was: ${origPrice}</strike></font><br/>
- <b>Now: ${salePrice}</b>
+ Item: ${name}<br/>
+ <font color="red"><strike>Was: ${origPrice}</strike></font><br/>
+ <b>Now: ${salePrice}</b>
</jsp:attribute>
</tags:displayProducts>
<hr>
<h2>Products (Same tag, alternate style)</h2>
<tags:displayProducts>
<jsp:attribute name="normalPrice">
- <b>${name}</b> @ ${price} ea.
+ <b>${name}</b> @ ${price} ea.
</jsp:attribute>
<jsp:attribute name="onSale">
- <b>${name}</b> @ ${salePrice} ea. (was: ${origPrice})
+ <b>${name}</b> @ ${salePrice} ea. (was: ${origPrice})
</jsp:attribute>
</tags:displayProducts>
</body>
diff --git a/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp b/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp
index 5f332ec..1b2b9fc 100644
--- a/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,7 +13,8 @@
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>
<body bgcolor="white">
<h1>
diff --git a/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp.html b/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp.html
index 44ac35e..d9e6138 100644
--- a/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsptoserv/hello.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,7 +14,8 @@
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>
<body bgcolor="white">
<h1>
diff --git a/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp b/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp
index c08192f..c2a460a 100644
--- a/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp
+++ b/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,7 +13,8 @@
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>
<body bgcolor="white">
<!-- Forward to a servlet -->
diff --git a/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp.html b/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp.html
index d694ab4..9e8ea56 100644
--- a/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,7 +14,8 @@
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>
<body bgcolor="white">
<!-- Forward to a servlet -->
diff --git a/tomcat-cas/webapps/examples/jsp/jsptoserv/jts.html b/tomcat-cas/webapps/examples/jsp/jsptoserv/jts.html
index ec7d5ad..20aa42b 100644
--- a/tomcat-cas/webapps/examples/jsp/jsptoserv/jts.html
+++ b/tomcat-cas/webapps/examples/jsp/jsptoserv/jts.html
@@ -27,7 +27,7 @@
<h3><a href="jsptoservlet.jsp.html">Source Code for JSP calling servlet <font color="#0000FF"></a>
</font> </h3>
-<h3><a href="servletToJsp.java.html">Source Code for Servlet calling JSP
+<h3><a href="ServletToJsp.java.html">Source Code for Servlet calling JSP
<font color="#0000FF"></a> </font> </h3>
</body>
diff --git a/tomcat-cas/webapps/examples/jsp/jsptoserv/servletToJsp.java.html b/tomcat-cas/webapps/examples/jsp/jsptoserv/servletToJsp.java.html
index bf6f249..9e30da5 100644
--- a/tomcat-cas/webapps/examples/jsp/jsptoserv/servletToJsp.java.html
+++ b/tomcat-cas/webapps/examples/jsp/jsptoserv/servletToJsp.java.html
@@ -15,20 +15,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import javax.servlet.http.*;
-public class servletToJsp extends HttpServlet {
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+public class ServletToJsp extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
public void doGet (HttpServletRequest request,
- HttpServletResponse response) {
+ HttpServletResponse response) {
- try {
- // Set the attribute and Forward to hello.jsp
- request.setAttribute ("servletName", "servletToJsp");
- getServletConfig().getServletContext().getRequestDispatcher("/jsp/jsptoserv/hello.jsp").forward(request, response);
- } catch (Exception ex) {
- ex.printStackTrace ();
- }
+ try {
+ // Set the attribute and Forward to hello.jsp
+ request.setAttribute ("servletName", "servletToJsp");
+ getServletConfig().getServletContext().getRequestDispatcher(
+ "/jsp/jsptoserv/hello.jsp").forward(request, response);
+ } catch (Exception ex) {
+ ex.printStackTrace ();
+ }
}
}
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/num/numguess.jsp b/tomcat-cas/webapps/examples/jsp/num/numguess.jsp
index cfcf6fb..a30eeb5 100644
--- a/tomcat-cas/webapps/examples/jsp/num/numguess.jsp
+++ b/tomcat-cas/webapps/examples/jsp/num/numguess.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -17,7 +17,7 @@
Number Guess Game
Written by Jason Hunter, CTO, K&A Software
http://www.servlets.com
--->
+--%>
<%@ page import = "num.NumberGuessBean" %>
diff --git a/tomcat-cas/webapps/examples/jsp/num/numguess.jsp.html b/tomcat-cas/webapps/examples/jsp/num/numguess.jsp.html
index 01fef5d..3362ac4 100644
--- a/tomcat-cas/webapps/examples/jsp/num/numguess.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/num/numguess.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -18,7 +18,7 @@
Number Guess Game
Written by Jason Hunter, CTO, K&A Software
http://www.servlets.com
--->
+--%>
<%@ page import = "num.NumberGuessBean" %>
diff --git a/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.class b/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.class
index 32fa663..cc968cd 100644
--- a/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.class
+++ b/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.class
Binary files differ
diff --git a/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.java b/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.java
index f228b82..ccc96d1 100644
--- a/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.java
+++ b/tomcat-cas/webapps/examples/jsp/plugin/applet/Clock2.java
@@ -15,10 +15,13 @@
* limitations under the License.
*/
-import java.util.*;
-import java.awt.*;
-import java.applet.*;
-import java.text.*;
+import java.applet.Applet;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
/**
* Time!
@@ -27,9 +30,10 @@
*/
public class Clock2 extends Applet implements Runnable {
+ private static final long serialVersionUID = 1L;
Thread timer; // The thread that displays clock
int lastxs, lastys, lastxm,
- lastym, lastxh, lastyh; // Dimensions used to draw hands
+ lastym, lastxh, lastyh; // Dimensions used to draw hands
SimpleDateFormat formatter; // Formats the date displayed
String lastdate; // String to hold date displayed
Font clockFaceFont; // Font for number display on clock
@@ -37,8 +41,8 @@
Color handColor; // Color of main hands and dial
Color numberColor; // Color of second hand and numbers
+ @Override
public void init() {
- int x,y;
lastxs = lastys = lastxm = lastym = lastxh = lastyh = 0;
formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy", Locale.getDefault());
currentDate = new Date();
@@ -96,6 +100,7 @@
}
// Paint is the main part of the program
+ @Override
public void paint(Graphics g) {
int xh, yh, xm, ym, xs, ys, s = 0, m = 10, h = 10, xcenter, ycenter;
String today;
@@ -112,7 +117,7 @@
m = Integer.parseInt(formatter.format(currentDate));
} catch (NumberFormatException n) {
m = 10;
- }
+ }
formatter.applyPattern("h");
try {
h = Integer.parseInt(formatter.format(currentDate));
@@ -123,30 +128,30 @@
today = formatter.format(currentDate);
xcenter=80;
ycenter=55;
-
+
// a= s* pi/2 - pi/2 (to switch 0,0 from 3:00 to 12:00)
// x = r(cos a) + xcenter, y = r(sin a) + ycenter
-
+
xs = (int)(Math.cos(s * 3.14f/30 - 3.14f/2) * 45 + xcenter);
ys = (int)(Math.sin(s * 3.14f/30 - 3.14f/2) * 45 + ycenter);
xm = (int)(Math.cos(m * 3.14f/30 - 3.14f/2) * 40 + xcenter);
ym = (int)(Math.sin(m * 3.14f/30 - 3.14f/2) * 40 + ycenter);
xh = (int)(Math.cos((h*30 + m/2) * 3.14f/180 - 3.14f/2) * 30 + xcenter);
yh = (int)(Math.sin((h*30 + m/2) * 3.14f/180 - 3.14f/2) * 30 + ycenter);
-
+
// Draw the circle and numbers
-
+
g.setFont(clockFaceFont);
g.setColor(handColor);
circle(xcenter,ycenter,50,g);
g.setColor(numberColor);
- g.drawString("9",xcenter-45,ycenter+3);
+ g.drawString("9",xcenter-45,ycenter+3);
g.drawString("3",xcenter+40,ycenter+3);
g.drawString("12",xcenter-5,ycenter-37);
g.drawString("6",xcenter-3,ycenter+45);
// Erase if necessary, and redraw
-
+
g.setColor(getBackground());
if (xs != lastxs || ys != lastys) {
g.drawLine(xcenter, ycenter, lastxs, lastys);
@@ -160,7 +165,7 @@
g.drawLine(xcenter-1, ycenter, lastxh, lastyh); }
g.setColor(numberColor);
g.drawString("", 5, 125);
- g.drawString(today, 5, 125);
+ g.drawString(today, 5, 125);
g.drawLine(xcenter, ycenter, xs, ys);
g.setColor(handColor);
g.drawLine(xcenter, ycenter-1, xm, ym);
@@ -174,34 +179,40 @@
currentDate=null;
}
+ @Override
public void start() {
timer = new Thread(this);
timer.start();
}
+ @Override
public void stop() {
timer = null;
}
+ @Override
public void run() {
Thread me = Thread.currentThread();
while (timer == me) {
try {
- Thread.currentThread().sleep(100);
+ Thread.sleep(100);
} catch (InterruptedException e) {
}
repaint();
}
}
+ @Override
public void update(Graphics g) {
paint(g);
}
+ @Override
public String getAppletInfo() {
return "Title: A Clock \nAuthor: Rachel Gollub, 1995 \nAn analog clock.";
}
-
+
+ @Override
public String[][] getParameterInfo() {
String[][] info = {
{"bgcolor", "hexadecimal RGB number", "The background color. Default is the color of your browser."},
diff --git a/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp b/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp
index 12db7d4..3347f6e 100644
--- a/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp
+++ b/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,7 +13,8 @@
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>
<title> Plugin example </title>
<body bgcolor="white">
<h3> Current time is : </h3>
@@ -25,7 +25,7 @@
</jsp:plugin>
<p>
<h4>
-<font color=red>
+<font color=red>
The above applet is loaded using the Java Plugin from a jsp page using the
plugin tag.
</font>
diff --git a/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp.html b/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp.html
index b350d5e..121b375 100644
--- a/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/plugin/plugin.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,7 +14,8 @@
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>
<title> Plugin example </title>
<body bgcolor="white">
<h3> Current time is : </h3>
@@ -26,7 +26,7 @@
</jsp:plugin>
<p>
<h4>
-<font color=red>
+<font color=red>
The above applet is loaded using the Java Plugin from a jsp page using the
plugin tag.
</font>
diff --git a/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp b/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp
index 50e0ed5..db7a466 100644
--- a/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp
+++ b/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>Error Page For Examples</title>
diff --git a/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp.html b/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp.html
index d45fb6c..950029e 100644
--- a/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/security/protected/error.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>Error Page For Examples</title>
diff --git a/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp b/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp
index bef9700..1d6495c 100644
--- a/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp
+++ b/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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.
--->
+--%>
<%
if (request.getParameter("logoff") != null) {
session.invalidate();
diff --git a/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp.html b/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp.html
index b8a9a54..399f05c 100644
--- a/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/security/protected/index.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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.
--->
+--%>
<%
if (request.getParameter("logoff") != null) {
session.invalidate();
diff --git a/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp b/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp
index dc7e50e..8b6d483 100644
--- a/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp
+++ b/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>Login Page for Examples</title>
diff --git a/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp.html b/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp.html
index 94e16ef..a516764 100644
--- a/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/security/protected/login.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>Login Page for Examples</title>
diff --git a/tomcat-cas/webapps/examples/jsp/sessions/carts.html b/tomcat-cas/webapps/examples/jsp/sessions/carts.html
index fe7dbb5..e972327 100644
--- a/tomcat-cas/webapps/examples/jsp/sessions/carts.html
+++ b/tomcat-cas/webapps/examples/jsp/sessions/carts.html
@@ -47,7 +47,7 @@
<INPUT TYPE=submit name="submit" value="remove">
</form>
-
+
</FONT>
</body>
</html>
diff --git a/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp b/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp
index e84170a..8847e58 100644
--- a/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp
+++ b/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,26 +13,26 @@
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>
<jsp:useBean id="cart" scope="session" class="sessions.DummyCart" />
<jsp:setProperty name="cart" property="*" />
<%
- cart.processRequest();
+ cart.processRequest();
%>
<FONT size = 5 COLOR="#CC0000">
<br> You have the following items in your cart:
<ol>
-<%
- String[] items = cart.getItems();
- for (int i=0; i<items.length; i++) {
-%>
-<li> <% out.print(util.HTMLFilter.filter(items[i])); %>
<%
- }
+ String[] items = cart.getItems();
+ for (int i=0; i<items.length; i++) {
+%>
+<li> <% out.print(util.HTMLFilter.filter(items[i])); %>
+<%
+ }
%>
</ol>
diff --git a/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp.html b/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp.html
index 92d40c9..9c7add0 100644
--- a/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/sessions/carts.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,26 +14,26 @@
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>
<jsp:useBean id="cart" scope="session" class="sessions.DummyCart" />
<jsp:setProperty name="cart" property="*" />
<%
- cart.processRequest();
+ cart.processRequest();
%>
<FONT size = 5 COLOR="#CC0000">
<br> You have the following items in your cart:
<ol>
-<%
- String[] items = cart.getItems();
- for (int i=0; i<items.length; i++) {
-%>
-<li> <% out.print(util.HTMLFilter.filter(items[i])); %>
<%
- }
+ String[] items = cart.getItems();
+ for (int i=0; i<items.length; i++) {
+%>
+<li> <% out.print(util.HTMLFilter.filter(items[i])); %>
+<%
+ }
%>
</ol>
diff --git a/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp b/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp
index 19ff087..a31890c 100644
--- a/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp
+++ b/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,9 +13,10 @@
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>
<body>
-<%@ taglib uri="http://tomcat.apache.org/examples-taglib" prefix="eg"%>
+<%@ taglib uri="http://tomcat.apache.org/example-taglib" prefix="eg"%>
Radio stations that rock:
diff --git a/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp.html b/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp.html
index ce7fb97..30c6272 100644
--- a/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/simpletag/foo.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,9 +14,10 @@
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>
<body>
-<%@ taglib uri="http://tomcat.apache.org/examples-taglib" prefix="eg"%>
+<%@ taglib uri="http://tomcat.apache.org/example-taglib" prefix="eg"%>
Radio stations that rock:
diff --git a/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp b/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp
index 06a3830..500a648 100644
--- a/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp
+++ b/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp
@@ -1,5 +1,4 @@
-<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.
@@ -14,8 +13,8 @@
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>
<body bgcolor="white">
<h1> Request Information </h1>
<font size="4">
@@ -45,7 +44,7 @@
<br>
Remote host: <%= util.HTMLFilter.filter(request.getRemoteHost()) %>
<br>
-Authorization scheme: <%= util.HTMLFilter.filter(request.getAuthType()) %>
+Authorization scheme: <%= util.HTMLFilter.filter(request.getAuthType()) %>
<br>
Locale: <%= request.getLocale() %>
<hr>
diff --git a/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp.html b/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp.html
index 13025fb..ad7be57 100644
--- a/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/snp/snoop.jsp.html
@@ -1,6 +1,5 @@
<html><body><pre>
-<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.
@@ -15,8 +14,8 @@
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>
<body bgcolor="white">
<h1> Request Information </h1>
<font size="4">
@@ -46,7 +45,7 @@
<br>
Remote host: <%= util.HTMLFilter.filter(request.getRemoteHost()) %>
<br>
-Authorization scheme: <%= util.HTMLFilter.filter(request.getAuthType()) %>
+Authorization scheme: <%= util.HTMLFilter.filter(request.getAuthType()) %>
<br>
Locale: <%= request.getLocale() %>
<hr>
diff --git a/tomcat-cas/webapps/examples/jsp/source.jsp b/tomcat-cas/webapps/examples/jsp/source.jsp
index efa329a..12a660c 100644
--- a/tomcat-cas/webapps/examples/jsp/source.jsp
+++ b/tomcat-cas/webapps/examples/jsp/source.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,8 +13,8 @@
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 uri="http://tomcat.apache.org/examples-taglib"
+--%>
+<%@ taglib uri="http://tomcat.apache.org/example-taglib"
prefix="eg" %>
<eg:ShowSource jspFile="<%= util.HTMLFilter.filter(request.getQueryString()) %>"/>
diff --git a/tomcat-cas/webapps/examples/jsp/source.jsp.html b/tomcat-cas/webapps/examples/jsp/source.jsp.html
index 841dd3f..8c3f367 100644
--- a/tomcat-cas/webapps/examples/jsp/source.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/source.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,8 +14,8 @@
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 uri="http://tomcat.apache.org/examples-taglib"
+--%>
+<%@ taglib uri="http://tomcat.apache.org/example-taglib"
prefix="eg" %>
<eg:ShowSource jspFile="<%= util.HTMLFilter.filter(request.getQueryString()) %>"/>
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp b/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp
index 2427249..52a9011 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>Tag Examples - choose</title>
@@ -21,38 +21,34 @@
<body>
<h1>Tag Plugin Examples - <c:choose></h1>
- <hr>
- </br>
- <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
-a>
+ <hr/>
<br/>
- <a href="howto.html">Brief Instructions for Writing Plugins<font color="#000
-0
-FF"></a>
+ <a href="notes.html">Plugin Introductory Notes</a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins</a>
<br/> <br/>
- <hr>
+ <hr/>
- <font color="#000000"/>
- </br>
+ <br/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:forEach var="index" begin="0" end="4">
- # ${index}:
+ # ${index}:
<c:choose>
- <c:when test="${index == 1}">
- One!</br>
- </c:when>
- <c:when test="${index == 4}">
- Four!</br>
- </c:when>
- <c:when test="${index == 3}">
- Three!</br>
- </c:when>
- <c:otherwise>
- Huh?</br>
- </c:otherwise>
+ <c:when test="${index == 1}">
+ One!<br/>
+ </c:when>
+ <c:when test="${index == 4}">
+ Four!<br/>
+ </c:when>
+ <c:when test="${index == 3}">
+ Three!<br/>
+ </c:when>
+ <c:otherwise>
+ Huh?<br/>
+ </c:otherwise>
</c:choose>
</c:forEach>
</body>
-</html>
+</html>
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp.html b/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp.html
index d95ab00..5d70ede 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/choose.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>Tag Examples - choose</title>
@@ -22,39 +22,35 @@
<body>
<h1>Tag Plugin Examples - &lt;c:choose></h1>
- <hr>
- </br>
- <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
-a>
+ <hr/>
<br/>
- <a href="howto.html">Brief Instructions for Writing Plugins<font color="#000
-0
-FF"></a>
+ <a href="notes.html">Plugin Introductory Notes</a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins</a>
<br/> <br/>
- <hr>
+ <hr/>
- <font color="#000000"/>
- </br>
+ <br/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:forEach var="index" begin="0" end="4">
- # ${index}:
+ # ${index}:
<c:choose>
- <c:when test="${index == 1}">
- One!</br>
- </c:when>
- <c:when test="${index == 4}">
- Four!</br>
- </c:when>
- <c:when test="${index == 3}">
- Three!</br>
- </c:when>
- <c:otherwise>
- Huh?</br>
- </c:otherwise>
+ <c:when test="${index == 1}">
+ One!<br/>
+ </c:when>
+ <c:when test="${index == 4}">
+ Four!<br/>
+ </c:when>
+ <c:when test="${index == 3}">
+ Three!<br/>
+ </c:when>
+ <c:otherwise>
+ Huh?<br/>
+ </c:otherwise>
</c:choose>
</c:forEach>
</body>
-</html>
+</html>
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp b/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp
index 135d5ed..a7a57c5 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>Tag Plugin Examples: forEach</title>
@@ -21,18 +21,15 @@
<body>
<h1>Tag Plugin Examples - <c:forEach></h1>
- <hr>
- </br>
- <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
-a>
+ <hr/>
<br/>
- <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000
-FF"></a>
+ <a href="notes.html">Plugin Introductory Notes</a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins</a>
<br/> <br/>
- <hr>
+ <hr/>
- <font color="#000000"/>
- </br>
+ <br/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.Vector" %>
@@ -43,15 +40,15 @@
</c:forEach>
<% Vector v = new Vector();
- v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
+ v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
- pageContext.setAttribute("vector", v);
+ pageContext.setAttribute("vector", v);
%>
<h3>Iterating over a Vector</h3>
<c:forEach items="${vector}" var="item" >
- ${item}
+ ${item}
</c:forEach>
</body>
-</html>
+</html>
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp.html b/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp.html
index 1d153c1..1f63f15 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/foreach.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>Tag Plugin Examples: forEach</title>
@@ -22,18 +22,15 @@
<body>
<h1>Tag Plugin Examples - &lt;c:forEach></h1>
- <hr>
- </br>
- <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
-a>
+ <hr/>
<br/>
- <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000
-FF"></a>
+ <a href="notes.html">Plugin Introductory Notes</a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins</a>
<br/> <br/>
- <hr>
+ <hr/>
- <font color="#000000"/>
- </br>
+ <br/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.Vector" %>
@@ -44,16 +41,16 @@
</c:forEach>
<% Vector v = new Vector();
- v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
+ v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
- pageContext.setAttribute("vector", v);
+ pageContext.setAttribute("vector", v);
%>
<h3>Iterating over a Vector</h3>
<c:forEach items="${vector}" var="item" >
- ${item}
+ ${item}
</c:forEach>
</body>
-</html>
+</html>
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/howto.html b/tomcat-cas/webapps/examples/jsp/tagplugin/howto.html
index 02e746d..a193228 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/howto.html
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/howto.html
@@ -21,12 +21,12 @@
<body>
<h2>How to write tag plugins</h2>
<p>
- To write a plugin, you'll need to download the source for Tomcat 5.
+ To write a plugin, you'll need to download the source for Tomcat.
There are two steps:
<ol>
<li>
Implement the plugin class.<p/>
- This class, which implements
+ This class, which implements
<tt>org.apache.jasper.compiler.tagplugin.TagPlugin</tt>
instructs Jasper what Java codes to generate in place of the tag
handler calls.
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp b/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp
index ad9414a..70ad14e 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp
@@ -1,4 +1,4 @@
-<!--
+<%--
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.
@@ -13,7 +13,7 @@
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>Tag Plugin Examples: if</title>
@@ -21,25 +21,27 @@
<body>
<h1>Tag Plugin Examples - <c:if></h1>
- <hr>
- </br>
- <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></a>
+ <hr/>
<br/>
- <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000FF"></a>
+ <a href="notes.html">Plugin Introductory Notes</a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins</a>
<br/> <br/>
- <hr>
+ <hr/>
- <font color="#000000"/>
- </br>
+ <br/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<h3>Set the test result to a variable</h3>
- <c:if test="${1==1}" var="theTruth" scope="session"/>
+ <c:if test="${1==1}" var="theTruth" scope="page"/>
The result of testing for (1==1) is: ${theTruth}
<h3>Conditionally execute the body</h3>
<c:if test="${2>0}">
- It's true that (2>0)!
+ <p>It's true that (2>0)! Working.</p>
+ </c:if>
+ <c:if test="${0>2}">
+ <p>It's not true that (0>2)! Failed.</p>
</c:if>
</body>
-</html>
+</html>
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp.html b/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp.html
index efcefe4..ca05498 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/if.jsp.html
@@ -1,5 +1,5 @@
<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.
@@ -14,7 +14,7 @@
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>Tag Plugin Examples: if</title>
@@ -22,26 +22,28 @@
<body>
<h1>Tag Plugin Examples - &lt;c:if></h1>
- <hr>
- </br>
- <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></a>
+ <hr/>
<br/>
- <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000FF"></a>
+ <a href="notes.html">Plugin Introductory Notes</a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins</a>
<br/> <br/>
- <hr>
+ <hr/>
- <font color="#000000"/>
- </br>
+ <br/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<h3>Set the test result to a variable</h3>
- <c:if test="${1==1}" var="theTruth" scope="session"/>
+ <c:if test="${1==1}" var="theTruth" scope="page"/>
The result of testing for (1==1) is: ${theTruth}
<h3>Conditionally execute the body</h3>
<c:if test="${2>0}">
- It's true that (2>0)!
+ <p>It's true that (2>0)! Working.</p>
+ </c:if>
+ <c:if test="${0>2}">
+ <p>It's not true that (0>2)! Failed.</p>
</c:if>
</body>
-</html>
+</html>
</pre></body></html>
diff --git a/tomcat-cas/webapps/examples/jsp/tagplugin/notes.html b/tomcat-cas/webapps/examples/jsp/tagplugin/notes.html
index 281a74c..0b10d40 100644
--- a/tomcat-cas/webapps/examples/jsp/tagplugin/notes.html
+++ b/tomcat-cas/webapps/examples/jsp/tagplugin/notes.html
@@ -21,17 +21,17 @@
<body>
<h2>Tag Plugins: Introductory Notes</h2>
<p>
- Tomcat 5 provides a framework for implementing tag plugins. The
+ Tomcat provides a framework for implementing tag plugins. The
plugins instruct Jasper, at translation time, to replace tag handler
calls with Java scriptlets.
The framework allows tag library authors to implement plugins for
their tags.
</p>
<p>
- Tomcat 5 is released with plugins for several JSTL tags. Note
+ Tomcat is released with plugins for several JSTL tags. Note
that these plugins work with JSTL 1.1 as well as JSTL 1.0, though
- the examples uses JSTL 1.1 and JSP 2.0.
- These plugins are not complete (for instance, some item types not
+ the examples uses JSTL 1.1 and JSP 2.0.
+ These plugins are not complete (for instance, some item types are not
handled in <c:if>).
They do serve as examples to show plugins in action (just
examine the generated Java files), and how they can be implemented.
diff --git a/tomcat-cas/webapps/examples/jsp/xml/xml.jsp b/tomcat-cas/webapps/examples/jsp/xml/xml.jsp
index e7ff43b..9b0c1fc 100644
--- a/tomcat-cas/webapps/examples/jsp/xml/xml.jsp
+++ b/tomcat-cas/webapps/examples/jsp/xml/xml.jsp
@@ -34,7 +34,7 @@
</head>
<body>
-This is the output of a simple JSP using XML format.
+This is the output of a simple JSP using XML format.
<br />
<div>Use a jsp:scriptlet to loop from 1 to 10: </div>
@@ -56,7 +56,7 @@
]]>
<div align="left">
- Use a jsp:expression to write the date and time in the browser's locale:
+ Use a jsp:expression to write the date and time in the browser's locale:
<jsp:expression>getDateTimeStr(request.getLocale())</jsp:expression>
</div>
diff --git a/tomcat-cas/webapps/examples/jsp/xml/xml.jsp.html b/tomcat-cas/webapps/examples/jsp/xml/xml.jsp.html
index 00d2980..b0b8274 100644
--- a/tomcat-cas/webapps/examples/jsp/xml/xml.jsp.html
+++ b/tomcat-cas/webapps/examples/jsp/xml/xml.jsp.html
@@ -35,7 +35,7 @@
</head>
<body>
-This is the output of a simple JSP using XML format.
+This is the output of a simple JSP using XML format.
<br />
<div>Use a jsp:scriptlet to loop from 1 to 10: </div>
@@ -57,7 +57,7 @@
]]>
<div align="left">
- Use a jsp:expression to write the date and time in the browser's locale:
+ Use a jsp:expression to write the date and time in the browser's locale:
<jsp:expression>getDateTimeStr(request.getLocale())</jsp:expression>
</div>