Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 14359 invoked by uid 500); 12 Feb 2003 03:03:11 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 14349 invoked by uid 500); 12 Feb 2003 03:03:11 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 12 Feb 2003 03:03:10 -0000 Message-ID: <20030212030310.44055.qmail@icarus.apache.org> From: vgritsenko@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/servlet CocoonServlet.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 2003/02/11 19:03:10 Modified: src/java/org/apache/cocoon/servlet Tag: cocoon_2_0_3_branch CocoonServlet.java Log: Port recent changes from the HEAD. Includes exception handling fixes. Revision Changes Path No revision No revision 1.19.2.16 +161 -156 xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java Index: CocoonServlet.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java,v retrieving revision 1.19.2.15 retrieving revision 1.19.2.16 diff -u -r1.19.2.15 -r1.19.2.16 --- CocoonServlet.java 7 Feb 2003 07:23:03 -0000 1.19.2.15 +++ CocoonServlet.java 12 Feb 2003 03:03:09 -0000 1.19.2.16 @@ -61,7 +61,6 @@ import org.apache.avalon.framework.logger.Loggable; import org.apache.cocoon.Constants; import org.apache.cocoon.components.notification.Notifying; -import org.apache.cocoon.components.notification.SimpleNotifyingBean; import org.apache.cocoon.components.notification.DefaultNotifyingBuilder; import org.apache.cocoon.components.notification.Notifier; import org.apache.cocoon.components.request.RequestFactory; @@ -89,15 +88,15 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; +import java.io.FileInputStream; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.io.FileOutputStream; -import java.io.StringWriter; -import java.io.PrintWriter; import java.lang.reflect.Constructor; import java.net.URL; import java.net.URLDecoder; +import java.net.MalformedURLException; import java.util.Arrays; import java.util.HashMap; import java.util.StringTokenizer; @@ -239,7 +238,6 @@ this.servletContext = conf.getServletContext(); this.appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, new HttpContext(this.servletContext)); - this.servletContextPath = this.servletContext.getRealPath("/"); // first init the work-directory for the logger. @@ -275,7 +273,7 @@ // Try to figure out the path of the root from that of WEB-INF try { path = this.servletContext.getResource("/WEB-INF").toString(); - } catch (java.net.MalformedURLException me) { + } catch (MalformedURLException me) { throw new ServletException("Unable to get resource 'WEB-INF'.", me); } if (log.isDebugEnabled()) { @@ -293,13 +291,13 @@ } else { this.servletContextURL = new File(path).toURL(); } - } catch (java.net.MalformedURLException me) { + } catch (MalformedURLException me) { // VG: Novell has absolute file names starting with the // volume name which is easily more then one letter. // Examples: sys:/apache/cocoon or sys:\apache\cocoon try { this.servletContextURL = new File(path).toURL(); - } catch (java.net.MalformedURLException ignored) { + } catch (MalformedURLException ignored) { throw new ServletException("Unable to determine servlet context URL.", me); } } @@ -490,15 +488,13 @@ */ public void destroy() { - if (this.initClassLoader) - { + if (this.initClassLoader) { try { Thread.currentThread().setContextClassLoader(this.classLoader); } catch (Exception e){} } - if (this.cocoon != null) - { + if (this.cocoon != null) { if (log.isDebugEnabled()) { log.debug("Servlet destroyed - disposing Cocoon"); } @@ -564,7 +560,7 @@ try { classDirURL = this.servletContext.getResource("/WEB-INF/classes"); - } catch (java.net.MalformedURLException me) { + } catch (MalformedURLException me) { if (log.isWarnEnabled()) { this.log.warn("Unable to add WEB-INF/classes to the classpath", me); } @@ -572,7 +568,7 @@ try { libDirURL = this.servletContext.getResource("/WEB-INF/lib"); - } catch (java.net.MalformedURLException me) { + } catch (MalformedURLException me) { if (log.isWarnEnabled()) { this.log.warn("Unable to add WEB-INF/lib to the classpath", me); } @@ -598,7 +594,7 @@ File[] libraries = root.listFiles(); Arrays.sort(libraries); for (int i = 0; i < libraries.length; i++) { - String fullName = IOUtils.getFullFilename(libraries[i]); + String fullName = IOUtils.getFullFilename(libraries[i]); buildClassPath.append(File.pathSeparatorChar).append(fullName); addClassLoaderDirectory(fullName); @@ -638,7 +634,7 @@ root.mkdirs(); File[] oldLibs = root.listFiles(); - for (int i=0; i