cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r306577 - in /cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context: RequestSessionContext.java StandardSessionContextProvider.java
Date Thu, 06 Oct 2005 10:23:27 GMT
Author: cziegeler
Date: Thu Oct  6 03:23:21 2005
New Revision: 306577

URL: http://svn.apache.org/viewcvs?rev=306577&view=rev
Log:
Log warning instead of writing it to system.err

Modified:
    cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java
    cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/StandardSessionContextProvider.java

Modified: cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java?rev=306577&r1=306576&r2=306577&view=diff
==============================================================================
--- cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java
(original)
+++ cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java
Thu Oct  6 03:23:21 2005
@@ -20,6 +20,7 @@
 import java.util.Enumeration;
 import java.util.Map;
 
+import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.ProcessingException;
@@ -123,6 +124,9 @@
     private static final String NAME_ELEMENT       = "cinclude:" + CIncludeTransformer.CINCLUDE_NAME_ELEMENT;
     private static final String VALUE_ELEMENT      = "cinclude:" + CIncludeTransformer.CINCLUDE_VALUE_ELEMENT;
 
+    /** The logger. */
+    protected Logger logger;
+
     /** Name of this context */
     private String    name;
 
@@ -135,6 +139,10 @@
     /** The XPath Processor */
     private XPathProcessor xpathProcessor;
 
+    public RequestSessionContext(Logger logger) {
+        this.logger = logger;
+    }
+
     /**
      * Setup this context
      */
@@ -287,10 +295,10 @@
                 attr = doc.createElementNS(null, attrName);
                 attrElement.appendChild(attr);
                 DOMUtil.valueOf(attr, this.request.getAttribute(attrName));
-            } catch(DOMException de) {
+            } catch (DOMException de) {
                 // Some request attributes have names that are invalid as element names.
                 // Example : "FOM JavaScript GLOBAL SCOPE/file://my/path/to/flow/script.js"
-                System.err.println("Cannot create XML element with name '" + attrName + "'
: " + de.getMessage());
+                this.logger.info("RequestSessionContext: Cannot create XML element from request
attribute '" + attrName + "' : " + de.getMessage());
             }
         }
     }

Modified: cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/StandardSessionContextProvider.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/StandardSessionContextProvider.java?rev=306577&r1=306576&r2=306577&view=diff
==============================================================================
--- cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/StandardSessionContextProvider.java
(original)
+++ cocoon/blocks/session-fw/trunk/java/org/apache/cocoon/webapps/session/context/StandardSessionContextProvider.java
Thu Oct  6 03:23:21 2005
@@ -71,7 +71,7 @@
                 context = new SimpleSessionContext(this.xpathProcessor, this.resolver);
                 context.setup(name, null, null);
             } else if ( name.equals(SessionConstants.REQUEST_CONTEXT) ) {
-                context = new RequestSessionContext();
+                context = new RequestSessionContext(this.getLogger());
                 context.setup(name, null, null);
                 ((RequestSessionContext)context).setup( objectModel, this.manager, this.xpathProcessor
);
             }



Mime
View raw message