--- a/src/examples/tomcat/apache-tomcat-6.0.35-src/java-extras/stx/libjava/tomcat/loader/SmalltalkWebappClassLoader.java Sun Jul 29 14:39:54 2012 +0000
+++ b/src/examples/tomcat/apache-tomcat-6.0.35-src/java-extras/stx/libjava/tomcat/loader/SmalltalkWebappClassLoader.java Mon Jul 30 10:18:10 2012 +0000
@@ -11,40 +11,48 @@
*/
public class SmalltalkWebappClassLoader extends WebappClassLoader {
- ClassLoader scl;
+ ClassLoader stcl;
- public SmalltalkWebappClassLoader() {
- init();
- }
+ public SmalltalkWebappClassLoader() {
+ init();
+ }
- public SmalltalkWebappClassLoader(ClassLoader parent) {
- super(parent);
- init();
- }
+ public SmalltalkWebappClassLoader(ClassLoader parent) {
+ super(parent);
+ init();
+ }
- protected void init() {
- try {
- Class<ClassLoader> sclClass = (Class<ClassLoader>) Class.forName("stx.libjava.ClassLoader");
- Method m = sclClass.getMethod("getSystemClassLoader", new Class[0] );
- scl = (ClassLoader)m.invoke(null, new Object[0]);
- } catch (ClassNotFoundException e1) {
- // Not running under stx:libjava?
- scl = null;
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ protected void init() {
+ try {
+ Class<ClassLoader> sclClass = (Class<ClassLoader>) Class.forName("stx.libjava.ClassLoader");
+ Method m = sclClass.getMethod("getSystemClassLoader", new Class[0] );
+ stcl = (ClassLoader)m.invoke(null, new Object[0]);
+ } catch (ClassNotFoundException e1) {
+ // Not running under stx:libjava?
+ stcl = null;
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
+ }
+
+ public Class findClass(String name) throws ClassNotFoundException {
+ if ((stcl != null) && ( name.startsWith("SMALLTALK.") )) {
+ return stcl.loadClass(name);
+ } else {
+ return super.findClass(name);
+ }
+ }
}
--- a/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/META-INF/context.xml Sun Jul 29 14:39:54 2012 +0000
+++ b/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/META-INF/context.xml Mon Jul 30 10:18:10 2012 +0000
@@ -1,11 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<Context>
- <Loader loaderClass="stx.libjava.tomcat.loader.SmalltalkWebappClassLoader" />
+ <Loader loaderClass="stx.libjava.tomcat.loader.SmalltalkWebappClassLoader" />
- <!-- Uncomment this to enable Comet connection tacking (provides events
- on session expiration as well as webapp lifecycle) -->
- <!--
- <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
- -->
+ <!-- Uncomment this to enable Comet connection tacking (provides events
+ on session expiration as well as webapp lifecycle) -->
+ <!--
+ <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
+ -->
</Context>
\ No newline at end of file
--- a/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/WEB-INF/classes/stx/libjava/tomcat/HelloWorldExample.java Sun Jul 29 14:39:54 2012 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-package stx.libjava.tomcat;
-
-/*
-* 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.
-*/
-/* $Id: HelloWorldExample.java 500674 2007-01-27 23:15:00Z markt $
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-
-/**
- * The simplest possible servlet.
- *
- * @author James Duncan Davidson
- */
-
-public class HelloWorldExample extends HttpServlet {
-
-
- public void doGet(HttpServletRequest request,
- HttpServletResponse response)
- throws IOException, ServletException
- {
- ResourceBundle rb =
- ResourceBundle.getBundle("LocalStrings",request.getLocale());
- response.setContentType("text/html");
- PrintWriter out = response.getWriter();
-
- out.println("<html>");
- out.println("<head>");
-
- String title = rb.getString("helloworld.title");
-
- out.println("<title>" + title + "</title>");
- out.println("</head>");
- out.println("<body bgcolor=\"white\">");
-
- // note that all links are created to be relative. this
- // ensures that we can move the web application that this
- // servlet belongs to to a different place in the url
- // tree and not have any harmful side effects.
-
- // XXX
- // making these absolute till we work out the
- // addition of a PathInfo issue
-
- out.println("<a href=\"../helloworld.html\">");
- out.println("<img src=\"../images/code.gif\" height=24 " +
- "width=24 align=right border=0 alt=\"view code\"></a>");
- out.println("<a href=\"../index.html\">");
- out.println("<img src=\"../images/return.gif\" height=24 " +
- "width=24 align=right border=0 alt=\"return\"></a>");
- out.println("<h1>" + title + "</h1>");
-
- out.println("<table>");
- Enumeration<Object> e = System.getProperties().keys();
- while (e.hasMoreElements()) {
- String name = (String)e.nextElement();
- out.println("<tr>");
- if (name.equals("java.vm.version") ||
- name.equals("java.vm.vendor") ||
- name.equals("java.vm.name") ||
- name.equals("java.vendor.url")) {
- out.println("<td><b>" + name + "</b<td>");
- out.println(" : ");
- out.println("<td><b>" + System.getProperty(name) + "</b><td>");
- } else {
- out.println("<td>" + name + "<tt>");
- out.println(" : ");
- out.println("<td>" + System.getProperty(name) + "<td>");
- }
- out.println("</tr>");
- }
- out.println("</table>");
-
-
-
- out.println("</body>");
- out.println("</html>");
- }
-}
-
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/WEB-INF/classes/stx/libjava/tomcat/HelloWorldExampleJ.java Mon Jul 30 10:18:10 2012 +0000
@@ -0,0 +1,103 @@
+package stx.libjava.tomcat;
+
+/*
+* 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.
+*/
+/* $Id: HelloWorldExample.java 500674 2007-01-27 23:15:00Z markt $
+ *
+ */
+
+import java.io.*;
+import java.util.*;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+
+/**
+ * The simplest possible servlet.
+ *
+ * @author James Duncan Davidson
+ */
+
+public class HelloWorldExampleJ extends HttpServlet {
+
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ ResourceBundle rb =
+ ResourceBundle.getBundle("LocalStrings",request.getLocale());
+ response.setContentType("text/html");
+ PrintWriter out = response.getWriter();
+
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = rb.getString("helloworld.title");
+
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // note that all links are created to be relative. this
+ // ensures that we can move the web application that this
+ // servlet belongs to to a different place in the url
+ // tree and not have any harmful side effects.
+
+ // XXX
+ // making these absolute till we work out the
+ // addition of a PathInfo issue
+
+ out.println("<a href=\"../helloworld.html\">");
+ out.println("<img src=\"../images/code.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"view code\"></a>");
+ out.println("<a href=\"../index.html\">");
+ out.println("<img src=\"../images/return.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"return\"></a>");
+ out.println("<h1>" + title + "</h1>");
+
+ out.println("<table>");
+ Enumeration<Object> e = System.getProperties().keys();
+ while (e.hasMoreElements()) {
+ String name = (String)e.nextElement();
+ out.println("<tr>");
+ if (name.equals("java.vm.version") ||
+ name.equals("java.vm.vendor") ||
+ name.equals("java.vm.name") ||
+ name.equals("java.vendor.url")) {
+ out.println("<td><b>" + name + "</b<td>");
+ out.println(" : ");
+ out.println("<td><b>" + System.getProperty(name) + "</b><td>");
+ } else {
+ out.println("<td>" + name + "<tt>");
+ out.println(" : ");
+ out.println("<td>" + System.getProperty(name) + "<td>");
+ }
+ out.println("</tr>");
+ }
+ out.println("</table>");
+
+
+
+ out.println("</body>");
+ out.println("</html>");
+ }
+}
+
+
+
--- a/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/WEB-INF/web.xml Sun Jul 29 14:39:54 2012 +0000
+++ b/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/WEB-INF/web.xml Mon Jul 30 10:18:10 2012 +0000
@@ -29,28 +29,27 @@
<!-- Define servlets that are included in the example application -->
- <!--
- <servlet>
- <servlet-name>servletToJsp</servlet-name>
- <servlet-class>servletToJsp</servlet-class>
- </servlet>
- -->
-
- <!--
- <servlet-mapping>
- <servlet-name>ChatServlet</servlet-name>
- <url-pattern>/jsp/chat/chat</url-pattern>
- </servlet-mapping>
- -->
<servlet>
- <servlet-name>HelloWorld</servlet-name>
- <servlet-class>stx.libjava.tomcat.HelloWorldExample</servlet-class>
+ <servlet-name>HelloWorldExampleS</servlet-name>
+ <servlet-class>SMALLTALK.HelloWorldExampleS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>HelloWorldExampleS</servlet-name>
+ <url-pattern>/servlets/servlet/HelloWorldExampleS</url-pattern>
+ </servlet-mapping>
+
+
+ <servlet>
+ <servlet-name>HelloWorldExampleJ</servlet-name>
+ <servlet-class>stx.libjava.tomcat.HelloWorldExampleJ</servlet-class>
</servlet>
<servlet-mapping>
- <servlet-name>HelloWorld</servlet-name>
- <url-pattern>/HelloWorld</url-pattern>
+ <servlet-name>HelloWorldExampleJ</servlet-name>
+ <url-pattern>/servlets/servlet/HelloWorldExampleJ</url-pattern>
</servlet-mapping>
+
</web-app>
--- a/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/servlets/index.html Sun Jul 29 14:39:54 2012 +0000
+++ b/src/examples/tomcat/apache-tomcat-6.0.35-src/webapps/examples_small/servlets/index.html Mon Jul 30 10:18:10 2012 +0000
@@ -65,13 +65,22 @@
<br>
<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
<tr VALIGN=TOP>
-<td>Hello World</td>
+<td>Hello World (Smalltalk)</td>
-<td VALIGN=TOP WIDTH="30%"><a href="servlet/HelloWorldExample"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/HelloWorldExample">Execute</a></td>
+<td VALIGN=TOP WIDTH="30%"><a href="servlet/HelloWorldExampleS"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/HelloWorldExampleS">Execute</a></td>
<td WIDTH="30%"><a href="helloworld.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="helloworld.html">Source</a></td>
</tr>
+<tr VALIGN=TOP>
+<td>Hello World (Java)</td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="servlet/HelloWorldExampleJ"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/HelloWorldExampleJ">Execute</a></td>
+
+<td WIDTH="30%"><a href="helloworld.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="helloworld.html">Source</a></td>
+</tr>
+
+
<!--
<tr VALIGN=TOP>
<td>Request Info</td>