cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r219699 - in /cocoon/trunk/src/java/org/apache/cocoon: core/CoreUtil.java servlet/CocoonServlet.java
Date Tue, 19 Jul 2005 14:52:18 GMT
Author: cziegeler
Date: Tue Jul 19 07:52:15 2005
New Revision: 219699

URL: http://svn.apache.org/viewcvs?rev=219699&view=rev
Log:
Fix NPE when an error occurs

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
    cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java?rev=219699&r1=219698&r2=219699&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java Tue Jul 19 07:52:15 2005
@@ -288,6 +288,13 @@
     }
 
     /**
+     * Return the settings object.
+     */
+    public Settings getSettings() {
+        return this.settings;
+    }
+
+    /**
      * Instatiates the parent service manager, as specified in the
      * parent-service-manager init parameter.
      *

Modified: cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=219699&r1=219698&r2=219699&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java Tue Jul 19 07:52:15
2005
@@ -217,7 +217,7 @@
         }
 
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug(this.coreUtil.getCore().getSettings().toString());
+            getLogger().debug(this.coreUtil.getSettings().toString());
             getLogger().debug("getRealPath for /: " + this.servletContextPath);
             if (this.servletContextPath == null) {
                 getLogger().debug("getResource for /WEB-INF: " + debugPathOne);
@@ -226,11 +226,11 @@
         }
 
         this.containerEncoding = this.getInitParameter("container-encoding", "ISO-8859-1");
-        this.requestFactory = new RequestFactory(coreUtil.getCore().getSettings().isAutosaveUploads(),
+        this.requestFactory = new RequestFactory(coreUtil.getSettings().isAutosaveUploads(),
                                                  new File(coreUtil.getCore().getSettings().getUploadDirectory()),
-                                                 coreUtil.getCore().getSettings().isAllowOverwrite(),
-                                                 coreUtil.getCore().getSettings().isSilentlyRename(),
-                                                 coreUtil.getCore().getSettings().getMaxUploadSize(),
+                                                 coreUtil.getSettings().isAllowOverwrite(),
+                                                 coreUtil.getSettings().isSilentlyRename(),
+                                                 coreUtil.getSettings().getMaxUploadSize(),
                                                  this.containerEncoding);
 
         try {
@@ -267,7 +267,7 @@
 
         /* HACK for reducing class loader problems.                                     */
         /* example: xalan extensions fail if someone adds xalan jars in tomcat3.2.1/lib */
-        if (this.coreUtil.getCore().getSettings().isInitClassloader()) {
+        if (this.coreUtil.getSettings().isInitClassloader()) {
             try {
                 Thread.currentThread().setContextClassLoader(this.classLoader);
             } catch (Exception e) {
@@ -285,7 +285,7 @@
         // get the request (wrapped if contains multipart-form data)
         HttpServletRequest request;
         try{
-            if (this.coreUtil.getCore().getSettings().isEnableUploads()) {
+            if (this.coreUtil.getSettings().isEnableUploads()) {
                 request = requestFactory.getServletRequest(req);
             } else {
                 request = req;
@@ -440,7 +440,7 @@
 
             if (contentType != null && contentType.equals("text/html")) {
                 String showTime = request.getParameter(Constants.SHOWTIME_PARAM);
-                boolean show = this.coreUtil.getCore().getSettings().isShowTime();
+                boolean show = this.coreUtil.getSettings().isShowTime();
                 if (showTime != null) {
                     show = !showTime.equalsIgnoreCase("no");
                 }
@@ -448,7 +448,7 @@
                     if ( timeString == null ) {
                         timeString = processTime(stopWatch.getTime());
                     }
-                    boolean hide = this.coreUtil.getCore().getSettings().isHideShowTime();
+                    boolean hide = this.coreUtil.getSettings().isHideShowTime();
                     if (showTime != null) {
                         hide = showTime.equalsIgnoreCase("hide");
                     }
@@ -498,7 +498,7 @@
                                    String title, String message, String description,
                                    Exception e)
     throws IOException {
-        if (this.coreUtil.getCore().getSettings().isManageExceptions()) {
+        if (this.coreUtil.getSettings().isManageExceptions()) {
             if (env != null) {
                 env.tryResetResponse();
             } else {
@@ -556,7 +556,7 @@
 
         String formEncoding = req.getParameter("cocoon-form-encoding");
         if (formEncoding == null) {
-            formEncoding = this.coreUtil.getCore().getSettings().getFormEncoding();
+            formEncoding = this.coreUtil.getSettings().getFormEncoding();
         }
         env = new HttpEnvironment(uri,
                                   this.servletContextURL,



Mime
View raw message