You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by mo...@apache.org on 2009/12/01 10:18:03 UTC

svn commit: r885719 - in /incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp: OOB.jsp OOM.jsp deadlock.jsp hprofDump.jsp index.jsp

Author: monteith
Date: Tue Dec  1 10:18:02 2009
New Revision: 885719

URL: http://svn.apache.org/viewvc?rev=885719&view=rev
Log:
Fixup JSP line endings

Modified:
    incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOB.jsp
    incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOM.jsp
    incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/deadlock.jsp   (contents, props changed)
    incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/hprofDump.jsp
    incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/index.jsp   (props changed)

Modified: incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOB.jsp
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOB.jsp?rev=885719&r1=885718&r2=885719&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOB.jsp (original)
+++ incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOB.jsp Tue Dec  1 10:18:02 2009
@@ -1,60 +1,60 @@
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.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.    
- -->
-<!-- 
-	Generates an ArrayIndexOutOfBoundsException.
-	Try in IBM's Java 5 & 6 VMs:
-		-Xdump:system:events=gpf+abort+throw,filter=java/lang/ArrayIndexOutOfBoundsException,priority=255
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.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.    
+ -->
+<!-- 
+	Generates an ArrayIndexOutOfBoundsException.
+	Try in IBM's Java 5 & 6 VMs:
+		-Xdump:system:events=gpf+abort+throw,filter=java/lang/ArrayIndexOutOfBoundsException,priority=255
  -->
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <title>ArrayIndexOutOfBounds</title>
 </head>
 <body>
-<h1>OOB</h1>
-
-<%!
-	char[] oobArray= {'A','Z','E','R','T','Y'};
-%>
-
-Enter a number between 0 and <%= oobArray.length-1 %> and I'll print out a character.
-
-<form name="OOB" method="post" action="">
-<input type="text" name="index"/>
-<input type="submit" name="submit"/>
-
-</form>
-
-<%
-	String parameter = request.getParameter("index");
-	if (parameter != null) {
-		int index = Integer.parseInt(parameter);
-		
-		out.write("You entered \"" + parameter + "\".<br/>"+
-				"Well done, please accept this character: <big>"+
-				oobArray[index]+"</big>");
-		
-	}
-%>
+<h1>OOB</h1>
+
+<%!
+	char[] oobArray= {'A','Z','E','R','T','Y'};
+%>
+
+Enter a number between 0 and <%= oobArray.length-1 %> and I'll print out a character.
+
+<form name="OOB" method="post" action="">
+<input type="text" name="index"/>
+<input type="submit" name="submit"/>
+
+</form>
+
+<%
+	String parameter = request.getParameter("index");
+	if (parameter != null) {
+		int index = Integer.parseInt(parameter);
+		
+		out.write("You entered \"" + parameter + "\".<br/>"+
+				"Well done, please accept this character: <big>"+
+				oobArray[index]+"</big>");
+		
+	}
+%>
 
 </body>
-</html>
+</html>

Modified: incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOM.jsp
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOM.jsp?rev=885719&r1=885718&r2=885719&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOM.jsp (original)
+++ incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/OOM.jsp Tue Dec  1 10:18:02 2009
@@ -1,80 +1,80 @@
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.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.    
+<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>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <title>Out Of Memory</title>
 </head>
-<body>
-<h1><blink><font color="Red">WARNING!</font></blink></h1>
-Pressing the following button may kill your server, and will definitely cause it to 
-dump! Press once!
-<pre>
-JVM:
-<%
-	out.write(System.getProperty("java.vm.vendor")+", "+
-			System.getProperty("java.vm.name")+", "+			
-			System.getProperty("java.vm.version"));
-%>
-</pre>
-
-<form name="OOM" method="post" action="">
-<input type="submit" value="OOM" name="DoOOM"/>
-<input type="submit" value="StaticOOM" name="DoOOM"/>
-
-</form>
-<%@page import="java.util.HashMap" %>
-<%! static HashMap staticmap;
-	HashMap map;
-%>
-<%
-	String dumpType = request.getParameter("DoOOM");
-
-	if( "OOM".equals(dumpType)) {		
-		out.write("OOming "+System.getProperty("user.dir"));
-		out.flush();
-		
-		// HashMaps often cause problems.
-		map = new HashMap();
-		
-		long value = 0;
-		while (true) {
-			map.put(value, new byte[1048576]);
-			value++;
-		}
-	} else if( "StaticOOM".equals(dumpType)) {
-		out.write("Static OOming "+System.getProperty("user.dir"));
-		out.flush();
-		
-		// HashMaps often cause problems.
-
-		staticmap = new HashMap();
-		long value = 0;
-		while (true) {
-			staticmap.put(value, new byte[1048576]);
-			value++;
-		}
-	
-	}
+<body>
+<h1><blink><font color="Red">WARNING!</font></blink></h1>
+Pressing the following button may kill your server, and will definitely cause it to 
+dump! Press once!
+<pre>
+JVM:
+<%
+	out.write(System.getProperty("java.vm.vendor")+", "+
+			System.getProperty("java.vm.name")+", "+			
+			System.getProperty("java.vm.version"));
+%>
+</pre>
+
+<form name="OOM" method="post" action="">
+<input type="submit" value="OOM" name="DoOOM"/>
+<input type="submit" value="StaticOOM" name="DoOOM"/>
+
+</form>
+<%@page import="java.util.HashMap" %>
+<%! static HashMap staticmap;
+	HashMap map;
+%>
+<%
+	String dumpType = request.getParameter("DoOOM");
+
+	if( "OOM".equals(dumpType)) {		
+		out.write("OOming "+System.getProperty("user.dir"));
+		out.flush();
+		
+		// HashMaps often cause problems.
+		map = new HashMap();
+		
+		long value = 0;
+		while (true) {
+			map.put(value, new byte[1048576]);
+			value++;
+		}
+	} else if( "StaticOOM".equals(dumpType)) {
+		out.write("Static OOming "+System.getProperty("user.dir"));
+		out.flush();
+		
+		// HashMaps often cause problems.
+
+		staticmap = new HashMap();
+		long value = 0;
+		while (true) {
+			staticmap.put(value, new byte[1048576]);
+			value++;
+		}
+	
+	}
 %>
 </body>
 </html>
\ No newline at end of file

Modified: incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/deadlock.jsp
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/deadlock.jsp?rev=885719&r1=885718&r2=885719&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/deadlock.jsp (original)
+++ incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/deadlock.jsp Tue Dec  1 10:18:02 2009
@@ -1,98 +1,98 @@
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.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.    
- -->
-<!--  
-  This JSP should be run twice. In the first grabs lock A before
-  waiting to be notified, then it tries to grab lock B.
-  In the second run it grabs lock B then notifies the first run before
-  trying to get lock A.
-  
-  If run properly, causes a deadlock to occur. 
-  This is a toxic JSP to have on anything except a J2EE server that is
-  purely for demonstration purposes. 
+<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.    
+ -->
+<!--  
+  This JSP should be run twice. In the first grabs lock A before
+  waiting to be notified, then it tries to grab lock B.
+  In the second run it grabs lock B then notifies the first run before
+  trying to get lock A.
+  
+  If run properly, causes a deadlock to occur. 
+  This is a toxic JSP to have on anything except a J2EE server that is
+  purely for demonstration purposes. 
 -->
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <title>Deadlock</title>
 </head>
-<body>
+<body>
 Press reload to create deadlock.
-Getting lock...
-<%! static Object handShake = new Object(); 
-    static Object lockA = new Object(), lockB = new Object();
-    static volatile int state = 0;
-%>
-<pre>
-<%
-out.flush();
-int localState = 0;
-synchronized(handShake) {
-	localState = state++;
-}
-
-if (localState == 0) {
-	out.write("Getting lock A\n");
-	out.flush();
-	synchronized(lockA) {
-		synchronized(handShake) {
-			out.write("Got lock A, waiting for handshake\n");
-			out.flush();
-			handShake.wait();
-		}
-		out.write("Getting lock B\n");
-		out.flush();
-
-		synchronized(lockB) {			
-			out.write("Got lock B\n");
-			out.flush();
-		}
-		out.write("Released lock B\n");
-		out.flush();
-	}
-	out.write("Released lock A\n");
-	out.flush();
-} else {
-	out.write("Getting lock b\n");
-	out.flush();
-	synchronized(lockB) {
-		synchronized(handShake) {
-			out.write("Got lock B, notifying handshake\n");
-			out.flush();
-			handShake.notify();
-		}
-		out.write("Getting lock A\n");
-		out.flush();
-
-		synchronized(lockA) {
-			out.write("Got lock A\n");
-			out.flush();
-		}
-		out.write("Released lock A\n");
-		out.flush();
-	}
-	out.write("Released lock B\n");
-	out.flush();
-}
-%>
+Getting lock...
+<%! static Object handShake = new Object(); 
+    static Object lockA = new Object(), lockB = new Object();
+    static volatile int state = 0;
+%>
+<pre>
+<%
+out.flush();
+int localState = 0;
+synchronized(handShake) {
+	localState = state++;
+}
+
+if (localState == 0) {
+	out.write("Getting lock A\n");
+	out.flush();
+	synchronized(lockA) {
+		synchronized(handShake) {
+			out.write("Got lock A, waiting for handshake\n");
+			out.flush();
+			handShake.wait();
+		}
+		out.write("Getting lock B\n");
+		out.flush();
+
+		synchronized(lockB) {			
+			out.write("Got lock B\n");
+			out.flush();
+		}
+		out.write("Released lock B\n");
+		out.flush();
+	}
+	out.write("Released lock A\n");
+	out.flush();
+} else {
+	out.write("Getting lock b\n");
+	out.flush();
+	synchronized(lockB) {
+		synchronized(handShake) {
+			out.write("Got lock B, notifying handshake\n");
+			out.flush();
+			handShake.notify();
+		}
+		out.write("Getting lock A\n");
+		out.flush();
+
+		synchronized(lockA) {
+			out.write("Got lock A\n");
+			out.flush();
+		}
+		out.write("Released lock A\n");
+		out.flush();
+	}
+	out.write("Released lock B\n");
+	out.flush();
+}
+%>
 </pre>
 </body>
 </html>
\ No newline at end of file

Propchange: incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/deadlock.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/hprofDump.jsp
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/hprofDump.jsp?rev=885719&r1=885718&r2=885719&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/hprofDump.jsp (original)
+++ incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/hprofDump.jsp Tue Dec  1 10:18:02 2009
@@ -1,81 +1,81 @@
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.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.    
- -->
-<!-- 
-	Generates an hprof file using JMX. 
-	Do not place this on production servers.
+<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.    
+ -->
+<!-- 
+	Generates an hprof file using JMX. 
+	Do not place this on production servers.
  -->
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <title>HProf Dump</title>
 </head>
-<body>
-Generates an hprof file from the current heap state.
-<pre>
-JVM:
-<%
-	out.write(System.getProperty("java.vm.vendor") + ", "
-			+ System.getProperty("java.vm.name") + ", "
-			+ System.getProperty("java.vm.version"));
-%>
-</pre>
+<body>
+Generates an hprof file from the current heap state.
+<pre>
+JVM:
+<%
+	out.write(System.getProperty("java.vm.vendor") + ", "
+			+ System.getProperty("java.vm.name") + ", "
+			+ System.getProperty("java.vm.version"));
+%>
+</pre>
+
+<form name="Dump" method="post" action="">
+<input type="submit" value="hprof" name="Dump"/>
+</form>
+<%@page import="javax.management.*,java.lang.management.ManagementFactory,java.io.File" %>
+<%
+	String dumpType = request.getParameter("Dump");
 
-<form name="Dump" method="post" action="">
-<input type="submit" value="hprof" name="Dump"/>
-</form>
-<%@page import="javax.management.*,java.lang.management.ManagementFactory,java.io.File" %>
-<%
-	String dumpType = request.getParameter("Dump");
-
-	if ("hprof".equals(dumpType)) {
-		MBeanServer mbeanServer = ManagementFactory
-				.getPlatformMBeanServer();
-		String fileName = System.getProperty("user.dir")+File.separatorChar+"hprofDump"+
-					System.currentTimeMillis()+".hprof";
-		
-		out.write("Generating hprof file \""+fileName+"\"");
-		out.flush();
-		
-		try {
-			mbeanServer
-					.invoke(
-							ObjectName
-									.getInstance("com.sun.management:type=HotSpotDiagnostic"),
-							"dumpHeap", new Object[] {
-									fileName, true },
-							new String[] { "java.lang.String",
-									"boolean" });
-		} catch (InstanceNotFoundException e) {
-			e.printStackTrace();
-		} catch (MalformedObjectNameException e) {
-			e.printStackTrace();
-		} catch (MBeanException e) {
-			e.printStackTrace();
-		} catch (ReflectionException e) {
-			e.printStackTrace();
-		} catch (NullPointerException e) {
-			e.printStackTrace();
-		}
-	}
+	if ("hprof".equals(dumpType)) {
+		MBeanServer mbeanServer = ManagementFactory
+				.getPlatformMBeanServer();
+		String fileName = System.getProperty("user.dir")+File.separatorChar+"hprofDump"+
+					System.currentTimeMillis()+".hprof";
+		
+		out.write("Generating hprof file \""+fileName+"\"");
+		out.flush();
+		
+		try {
+			mbeanServer
+					.invoke(
+							ObjectName
+									.getInstance("com.sun.management:type=HotSpotDiagnostic"),
+							"dumpHeap", new Object[] {
+									fileName, true },
+							new String[] { "java.lang.String",
+									"boolean" });
+		} catch (InstanceNotFoundException e) {
+			e.printStackTrace();
+		} catch (MalformedObjectNameException e) {
+			e.printStackTrace();
+		} catch (MBeanException e) {
+			e.printStackTrace();
+		} catch (ReflectionException e) {
+			e.printStackTrace();
+		} catch (NullPointerException e) {
+			e.printStackTrace();
+		}
+	}
 %>
 </body>
 </html>
\ No newline at end of file

Propchange: incubator/kato/trunk/org.apache.kato/kato.demo.tomcat/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native