升级Tomcat版本 apache-tomcat-7.0.77
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html
index 0b15181..2711b30 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html
index c409839..6fb9b0d 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html
index 1b66d06..806cf7b 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html
index 4453222..2cd454b 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp
index 64b6d6e..02abbd1 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html
index eb3a927..088ed20 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp
index 2a318a7..424af35 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html
index 9329285..231eba6 100644
--- a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html
+++ b/tomcat-uid/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>