cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r565482 - in /cocoon/trunk/core: cocoon-core/src/main/java/org/apache/cocoon/environment/background/ cocoon-core/src/test/java/org/apache/cocoon/environment/mock/ cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environme...
Date Mon, 13 Aug 2007 19:37:11 GMT
Author: danielf
Date: Mon Aug 13 12:37:10 2007
New Revision: 565482

URL: http://svn.apache.org/viewvc?view=rev&rev=565482
Log:
Letting our environment abstractions extend the http servlet set of interfaces according to vote http://marc.info/?t=118623278200002&r=1&w=2.
Part 1: updating the interfaces and environment implementations.

Added:
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractResponse.java   (with props)
Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundRequest.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundResponse.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockResponse.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Cookie.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Request.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Response.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Session.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpCookie.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpResponse.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpSession.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractRequest.java
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractSession.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/AbstractRequestWrapper.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundRequest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundRequest.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundRequest.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundRequest.java Mon Aug 13 12:37:10 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.cocoon.environment.background;
 
-import java.io.InputStream;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -24,6 +23,9 @@
 import java.util.Map;
 import java.util.Vector;
 
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpSession;
+
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.environment.Cookie;
 import org.apache.cocoon.environment.Environment;
@@ -31,8 +33,8 @@
 import org.apache.cocoon.environment.Session;
 import org.apache.cocoon.environment.impl.AbstractRequest;
 import org.apache.commons.collections.IteratorUtils;
-import org.apache.commons.lang.SystemUtils;
 import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang.SystemUtils;
 
 /**
  * Creates a specific servlet request simulation from command line usage.
@@ -295,10 +297,14 @@
     public String getMethod() { return "get"; }
     public String getRemoteUser() { return SystemUtils.USER_NAME; }
 
-    public Cookie[] getCookies() { return null; }
+    public javax.servlet.http.Cookie[] getCookies() { return null; }
     public Map getCookieMap() {
         return Collections.unmodifiableMap(new HashMap());
     }
+    public Cookie[] getCocoonCookies() { return null; }
+    public Map getCocoonCookieMap() {
+        return Collections.unmodifiableMap(new HashMap());
+    }
 
     /**
      * Returns the current session associated with this request,
@@ -309,7 +315,7 @@
      *
      * @see        #getSession(boolean)
      */
-    public Session getSession() {
+    public HttpSession getSession() {
         return this.getSession(true);
     }
 
@@ -338,10 +344,24 @@
      *
      * @see  #getSession()
      */
-    public Session getSession(boolean create) {
+    public HttpSession getSession(boolean create) {
         return BackgroundSession.getSession(create);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getCocoonSession(boolean)
+     */
+    public Session getCocoonSession(boolean create) {
+        return (Session) getSession(create);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getCocoonSession()
+     */
+    public Session getCocoonSession() {
+        return (Session) getSession();
+    }
+    
     /**
      * Returns the session ID specified by the client. This may
      * not be the same as the ID of the actual session in use.
@@ -426,7 +446,7 @@
 	/*
 	 * @see org.apache.cocoon.environment.Request#getInputStream()
 	 */
-	public InputStream getInputStream() throws UnsupportedOperationException {
+	public ServletInputStream getInputStream() throws UnsupportedOperationException {
 		throw new UnsupportedOperationException();
 	}
 

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundResponse.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundResponse.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundResponse.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/environment/background/BackgroundResponse.java Mon Aug 13 12:37:10 2007
@@ -16,20 +16,23 @@
  */
 package org.apache.cocoon.environment.background;
 
+import java.util.Locale;
+
 import org.apache.cocoon.environment.Cookie;
 import org.apache.cocoon.environment.Response;
-
-import java.util.Locale;
+import org.apache.cocoon.environment.impl.AbstractResponse;
 
 /**
  * Creates a specific servlet response simulation from command line usage.
  *
  * @version $Id$
  */
-public class BackgroundResponse implements Response {
+public class BackgroundResponse extends AbstractResponse implements Response {
 
     public String getCharacterEncoding() { return null; }
-    public Cookie createCookie(String name, String value) { return null; }
+    public javax.servlet.http.Cookie createCookie(String name, String value) { return null; }
+    public void addCookie(javax.servlet.http.Cookie cookie) {}
+    public Cookie createCocoonCookie(String name, String value) { return null; }
     public void addCookie(Cookie cookie) {}
     public boolean containsHeader(String name) { return false; }
     public void setHeader(String name, String value) {}
@@ -41,4 +44,5 @@
     public void addDateHeader(String name, long date) { }
     public void addHeader(String name, String value) { }
     public void addIntHeader(String name, int value) { }
+
 }

Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java (original)
+++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequest.java Mon Aug 13 12:37:10 2007
@@ -19,16 +19,19 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.security.Principal;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.Enumeration;
-import java.util.Hashtable;
 import java.util.HashMap;
+import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Vector;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.text.ParseException;
+
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpSession;
 
 import junit.framework.AssertionFailedError;
 
@@ -70,6 +73,7 @@
     private Hashtable parameters = new Hashtable();
     private Hashtable headers = new Hashtable();
     private Map cookies = new HashMap();
+    private Map cocoonCookies = new HashMap();
     
     private MockSession session;
     private Environment environment;
@@ -247,12 +251,12 @@
     /**
      * @see org.apache.cocoon.environment.Request#getCookies()
      */
-    public Cookie[] getCookies() {
+    public javax.servlet.http.Cookie[] getCookies() {
         if (cookies.isEmpty()) {
             return null;
         }
-        Cookie[] cookieArray = new Cookie[cookies.size()];
-        return (Cookie []) cookies.values().toArray(cookieArray);
+        javax.servlet.http.Cookie[] cookieArray = new javax.servlet.http.Cookie[cookies.size()];
+        return (javax.servlet.http.Cookie[]) cookies.values().toArray(cookieArray);
     }
 
     /**
@@ -262,6 +266,18 @@
         return cookies;
     }
 
+    public Cookie[] getCocoonCookies() {
+        if (cocoonCookies.isEmpty()) {
+            return null;
+        }
+        Cookie[] cookieArray = new Cookie[cocoonCookies.size()];
+        return (Cookie[]) cocoonCookies.values().toArray(cookieArray);
+    }
+
+    public Map getCocoonCookieMap() {
+        return this.cocoonCookies;
+    }
+
     /**
      * @see org.apache.cocoon.environment.Request#getDateHeader(java.lang.String)
      */
@@ -425,7 +441,7 @@
     /**
      * @see org.apache.cocoon.environment.Request#getSession(boolean)
      */
-    public Session getSession(boolean create) {
+    public HttpSession getSession(boolean create) {
         if ((session == null) && (create)) {
             this.session = new MockSession();
         } else if ((session != null) && (!(session).isValid()) && (create)) {
@@ -440,7 +456,7 @@
     /**
      * @see org.apache.cocoon.environment.Request#getSession()
      */
-    public Session getSession() {
+    public HttpSession getSession() {
         return getSession(true);
     }
 
@@ -594,8 +610,12 @@
     /**
      * @see org.apache.cocoon.environment.Request#getInputStream()
      */
-    public InputStream getInputStream() throws IOException, UnsupportedOperationException {
-        return this.inputStream;
+    public ServletInputStream getInputStream() throws IOException, UnsupportedOperationException {
+        return new ServletInputStream() {
+            public int read() throws IOException {
+                return MockRequest.this.inputStream.read();
+            }
+        };
     }
 
     public void setInputStream(InputStream is) {
@@ -616,4 +636,15 @@
     public void setUserRole(String value) {
         this.userRole = value;
     }
+
+    public Session getCocoonSession(boolean create) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Session getCocoonSession() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
 }

Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java (original)
+++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockRequestAttributes.java Mon Aug 13 12:37:10 2007
@@ -22,8 +22,9 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.servlet.http.HttpSession;
+
 import org.apache.cocoon.environment.Request;
-import org.apache.cocoon.environment.Session;
 import org.springframework.web.context.request.RequestAttributes;
 
 /**
@@ -56,7 +57,7 @@
         if ( scope == RequestAttributes.SCOPE_SESSION ) {
             return this.request.getAttribute(key, Request.GLOBAL_SCOPE);
         }
-        final Session session = this.request.getSession(false);
+        final HttpSession session = this.request.getSession(false);
         if ( session != null ) {
             return session.getAttribute(key);
         }
@@ -81,7 +82,7 @@
             this.request.removeAttribute(key, Request.GLOBAL_SCOPE);
         }
         if ( scope == RequestAttributes.SCOPE_GLOBAL_SESSION ) {
-            final Session session = this.request.getSession(false);
+            final HttpSession session = this.request.getSession(false);
             if ( session != null ) {
                 session.removeAttribute(key);
             }
@@ -99,7 +100,7 @@
             this.request.setAttribute(key, value, Request.GLOBAL_SCOPE);
         }
         if ( scope == RequestAttributes.SCOPE_GLOBAL_SESSION ) {
-            final Session session = this.request.getSession(true);
+            final HttpSession session = this.request.getSession(true);
             session.setAttribute(key, value);
         }
     }

Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockResponse.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockResponse.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockResponse.java (original)
+++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/environment/mock/MockResponse.java Mon Aug 13 12:37:10 2007
@@ -24,12 +24,14 @@
 import org.apache.cocoon.environment.Cookie;
 import org.apache.cocoon.environment.Response;
 import org.apache.cocoon.environment.Session;
+import org.apache.cocoon.environment.impl.AbstractResponse;
 
-public class MockResponse implements Response {
+public class MockResponse extends AbstractResponse implements Response {
 
     private String encoding;
     private Locale locale;
     private Set cookies = new HashSet();
+    private Set cocoonCookies = new HashSet();
     private Map header = new HashMap();
 
     private Session session;
@@ -50,7 +52,16 @@
         return locale;
     }
 
-    public Cookie createCookie(String name, String value) {
+    public javax.servlet.http.Cookie createCookie(String name, String value) {
+        javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie(name, value);
+        return cookie;
+    }
+
+    public void addCookie(javax.servlet.http.Cookie cookie) {
+        cookies.add(cookie);
+    }
+
+    public Cookie createCocoonCookie(String name, String value) {
         MockCookie cookie = new MockCookie();
         cookie.setName(name);
         cookie.setValue(value);
@@ -58,7 +69,7 @@
     }
 
     public void addCookie(Cookie cookie) {
-        cookies.add(cookie);
+        cocoonCookies.add(cookie);
     }
 
     public Set getCookies() {

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Cookie.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Cookie.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Cookie.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Cookie.java Mon Aug 13 12:37:10 2007
@@ -50,6 +50,7 @@
  * (by RFC 2109) cookie specifications. By default, cookies are
  * created using Version 0 to ensure the best interoperability.
  *
+ * @deprecated Use {@link javax.servlet.http.Cookie} instead.
  *
  * @version $Id$
  */

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Request.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Request.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Request.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Request.java Mon Aug 13 12:37:10 2007
@@ -17,12 +17,15 @@
 package org.apache.cocoon.environment;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.security.Principal;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
 /**
  * Defines an interface to provide client request information .
  *
@@ -39,7 +42,7 @@
  * 
  * @version $Id$
  */
-public interface Request extends ValueHolder {
+public interface Request extends ValueHolder, HttpServletRequest {
 
     /**
      * This constant defines an request wide scope for the request attribute.
@@ -489,29 +492,55 @@
 
     /**
      *
-     * Returns an array containing all of the <code>Cookie</code>
+     * Returns an array containing all of the {@link javax.servlet.http.Cookie}
      * objects the client sent with this request.
      * This method returns <code>null</code> if no cookies were sent.
      *
-     * @return                an array of all the <code>Cookies</code>
+     * @return                an array of all the {@link javax.servlet.http.Cookie}
      *                        included with this request, or <code>null</code>
      *                        if the request has no cookies
      *
      *
      */
 
-    Cookie[] getCookies();
+    javax.servlet.http.Cookie[] getCookies();
 
     /**
-     * Returns a map of the <code>Cookie</code> objects the client sent
+     * Returns a map of the {@link javax.servlet.http.Cookie} objects the client sent
      * with this request, indexed by name. This method returns an empty
      * map if no cookies were sent.
      *
-     * @return a Map of <code>Cookie</code> objects
+     * @return a Map of {@link javax.servlet.http.Cookie} objects
      */
     Map getCookieMap();
 
     /**
+    *
+    * Returns an array containing all of the <code>Cookie</code>
+    * objects the client sent with this request.
+    * This method returns <code>null</code> if no cookies were sent.
+    *
+    * @return                an array of all the <code>Cookies</code>
+    *                        included with this request, or <code>null</code>
+    *                        if the request has no cookies
+    *
+    * @deprecated use {@link #getCookies()} instead.
+    */
+
+   Cookie[] getCocoonCookies();
+
+   /**
+    * Returns a map of the <code>Cookie</code> objects the client sent
+    * with this request, indexed by name. This method returns an empty
+    * map if no cookies were sent.
+    *
+    * @return a Map of <code>Cookie</code> objects
+    * 
+    * @deprecated use {@link #getCookieMap()} instead.
+    */
+   Map getCocoonCookieMap();
+
+    /**
      *
      * Returns the value of the specified request header
      * as a <code>long</code> value that represents a
@@ -639,7 +668,7 @@
      * @throws IOException            if an input or output exception occurred
      * @throws UnsupportedOperationException
      */
-    InputStream getInputStream() throws IOException, UnsupportedOperationException;
+    ServletInputStream getInputStream() throws IOException, UnsupportedOperationException;
 
     /**
      *
@@ -895,6 +924,55 @@
 
     /**
      *
+     * Returns the current {@link HttpSession}
+     * associated with this request or, if if there is no
+     * current session and <code>create</code> is true, returns
+     * a new session.
+     *
+     * <p>If <code>create</code> is <code>false</code>
+     * and the request has no valid <code>Session</code>,
+     * this method returns <code>null</code>.
+     *
+     * <p>To make sure the session is properly maintained,
+     * you must call this method before
+     * the response is committed.
+     *
+     *
+     *
+     *
+     * @param create          <code>true</code> to create
+     *                        a new session for this request if necessary;
+     *                        <code>false</code> to return <code>null</code>
+     *                        if there's no current session
+     *
+     *
+     * @return                 the {@link HttpSession} associated
+     *                        with this request or <code>null</code> if
+     *                         <code>create</code> is <code>false</code>
+     *                        and the request has no valid session
+     *
+     * @see        #getSession()
+     *
+     *
+     */
+
+    HttpSession getSession(boolean create);
+
+    /**
+     *
+     * Returns the current session associated with this request,
+     * or if the request does not have a session, creates one.
+     *
+     * @return                the {@link HttpSession} associated
+     *                        with this request
+     *
+     * @see        #getSession(boolean)
+     *
+     */
+
+     HttpSession getSession();
+     /**
+     *
      * Returns the current <code>Session</code>
      * associated with this request or, if if there is no
      * current session and <code>create</code> is true, returns
@@ -924,10 +1002,10 @@
      *
      * @see        #getSession()
      *
-     *
+     * @deprecated use {@link #getSession(boolean)} instead.
      */
 
-    Session getSession(boolean create);
+    Session getCocoonSession(boolean create);
 
     /**
      *
@@ -939,9 +1017,10 @@
      *
      * @see        #getSession(boolean)
      *
+     * @deprecated use {@link #getSession()} instead.
      */
 
-     Session getSession();
+     Session getCocoonSession();
 
     /**
      *

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Response.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Response.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Response.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Response.java Mon Aug 13 12:37:10 2007
@@ -18,12 +18,14 @@
 
 import java.util.Locale;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * Defines an interface to provide client response information.
  *
  * @version $Id$
  */
-public interface Response {
+public interface Response extends HttpServletResponse {
 
     /**
      * Returns the name of the charset used for
@@ -94,7 +96,48 @@
      *                                        by the cookie protocol
      *
      */
-    Cookie createCookie(String name, String value);
+    javax.servlet.http.Cookie createCookie(String name, String value);
+
+    /**
+     * Adds the specified cookie to the response.  This method can be called
+     * multiple times to set more than one cookie.
+     *
+     * @param cookie the Cookie to return to the client
+     *
+     */
+
+    void addCookie(javax.servlet.http.Cookie cookie);
+
+    /**
+     * Constructs a cookie with a specified name and value.
+     *
+     * <p>The name must conform to RFC 2109. That means it can contain
+     * only ASCII alphanumeric characters and cannot contain commas,
+     * semicolons, or white space or begin with a $ character. The cookie's
+     * name cannot be changed after creation.
+     *
+     * <p>The value can be anything the server chooses to send. Its
+     * value is probably of interest only to the server. The cookie's
+     * value can be changed after creation with the
+     * <code>setValue</code> method.
+     *
+     * <p>By default, cookies are created according to the Netscape
+     * cookie specification. The version can be changed with the
+     * <code>setVersion</code> method.
+     *
+     *
+     * @param name                         a <code>String</code> specifying the name of the cookie
+     *
+     * @param value                        a <code>String</code> specifying the value of the cookie
+     *
+     * @throws IllegalArgumentException        if the cookie name contains illegal characters
+     *                                        (for example, a comma, space, or semicolon)
+     *                                        or it is one of the tokens reserved for use
+     *                                        by the cookie protocol
+     *
+     * @deprecated use {@link #createCookie(String, String)} instead.
+     */
+    Cookie createCocoonCookie(String name, String value);
 
     /**
      * Adds the specified cookie to the response.  This method can be called
@@ -102,6 +145,7 @@
      *
      * @param cookie the Cookie to return to the client
      *
+     * @deprecated use {@link #addCookie(javax.servlet.http.Cookie)} instead.
      */
 
     void addCookie(Cookie cookie);

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Session.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Session.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Session.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Session.java Mon Aug 13 12:37:10 2007
@@ -19,6 +19,8 @@
 import java.util.Enumeration;
 import java.util.Map;
 
+import javax.servlet.http.HttpSession;
+
 /**
  *
  * Provides a way to identify a user across more than one page
@@ -46,7 +48,7 @@
  * @version $Id$
  */
 
-public interface Session {
+public interface Session extends HttpSession {
 
     /**
      *

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpCookie.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpCookie.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpCookie.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpCookie.java Mon Aug 13 12:37:10 2007
@@ -54,6 +54,8 @@
  *
  *
  * @version $Id$
+ * 
+ * @deprecated use {@link javax.servlet.http.Cookie} instead.
  */
 public final class HttpCookie
 implements Cookie {

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpRequest.java Mon Aug 13 12:37:10 2007
@@ -18,7 +18,7 @@
 
 import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStream;
+import java.lang.ref.WeakReference;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -26,9 +26,9 @@
 import java.util.Map;
 import java.util.Vector;
 import java.util.WeakHashMap;
-import java.lang.ref.WeakReference;
 
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.cocoon.environment.Cookie;
@@ -107,15 +107,39 @@
 
     private Cookie[] wrappedCookies = null;
     private Map wrappedCookieMap = null;
+    private Map cookieMap = null;
+
+    public javax.servlet.http.Cookie[] getCookies() {
+        return this.req.getCookies();
+    }
+
+    public Map getCookieMap() {
+        if (this.cookieMap == null) {
+            createCookieMap();
+        }
+        return this.cookieMap;
+    }
 
-    public Cookie[] getCookies() {
+    private synchronized void createCookieMap() {
+        Map cookieMap = new HashMap();
+        javax.servlet.http.Cookie[] cookies = this.req.getCookies();
+        if (cookies != null) {
+            for (int i=0; i < cookies.length; i++) {
+                javax.servlet.http.Cookie cookie = cookies[i];
+                cookieMap.put(cookie.getName(),cookie);
+            }
+        }
+        this.cookieMap = Collections.unmodifiableMap(cookieMap);
+    }
+
+    public Cookie[] getCocoonCookies() {
         if (this.wrappedCookieMap == null) {
             wrapCookies();
         }
         return this.wrappedCookies;
     }
 
-    public Map getCookieMap() {
+    public Map getCocoonCookieMap() {
         if (this.wrappedCookieMap == null) {
             wrapCookies();
         }
@@ -237,7 +261,7 @@
     /* (non-Javadoc)
      * @see org.apache.cocoon.environment.Request#getSession(boolean)
      */
-    public Session getSession(boolean create) {
+    public javax.servlet.http.HttpSession getSession(boolean create) {
         javax.servlet.http.HttpSession serverSession = this.req.getSession(create);
         HttpSession session;
         if (serverSession != null)
@@ -262,10 +286,18 @@
         return session;
     }
 
-    public Session getSession() {
+    public javax.servlet.http.HttpSession getSession() {
         return this.getSession(true);
     }
 
+    public Session getCocoonSession(boolean create) {
+        return (Session) this.getSession(true);
+    }
+
+    public Session getCocoonSession() {
+        return (Session) this.getSession(true);
+    }
+
     public boolean isRequestedSessionIdValid() {
         return this.req.isRequestedSessionIdValid();
     }
@@ -385,7 +417,7 @@
         return this.req.getContentType();
     }
 
-    public InputStream getInputStream() throws IOException {
+    public ServletInputStream getInputStream() throws IOException {
         return this.req.getInputStream();
     }
 

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpResponse.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpResponse.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpResponse.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpResponse.java Mon Aug 13 12:37:10 2007
@@ -16,22 +16,24 @@
  */
 package org.apache.cocoon.environment.http;
 
-import org.apache.cocoon.environment.Cookie;
-import org.apache.cocoon.environment.Response;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Locale;
 
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cocoon.environment.Cookie;
+import org.apache.cocoon.environment.Response;
+import org.apache.cocoon.environment.impl.AbstractResponse;
+
 /**
  * Implements the {@link org.apache.cocoon.environment.Response} interface
  * to provide response functionality in the HTTP servlets environment.
  * 
  * @version $Id$
  */
-public final class HttpResponse implements Response {
+public final class HttpResponse extends AbstractResponse implements Response {
 
     /** The real HttpServletResponse object */
     private final HttpServletResponse res;
@@ -46,7 +48,15 @@
     /**
      * Create a new cookie which is not added to the response
      */
-    public Cookie createCookie(String name, String value) {
+    public javax.servlet.http.Cookie createCookie(String name, String value) {
+        return new javax.servlet.http.Cookie(name, value);
+    }
+
+    public void addCookie(javax.servlet.http.Cookie cookie) {
+        this.res.addCookie(cookie);
+    }
+
+    public Cookie createCocoonCookie(String name, String value) {
         return new HttpCookie(name, value);
     }
 
@@ -205,5 +215,6 @@
     public Locale getLocale() {
         return this.res.getLocale();
     }
+
 }
 

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpSession.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpSession.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpSession.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpSession.java Mon Aug 13 12:37:10 2007
@@ -16,9 +16,9 @@
  */
 package org.apache.cocoon.environment.http;
 
-import org.apache.cocoon.environment.impl.AbstractSession;
-
 import java.util.Enumeration;
+
+import org.apache.cocoon.environment.impl.AbstractSession;
 
 /**
  *

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractRequest.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractRequest.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractRequest.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractRequest.java Mon Aug 13 12:37:10 2007
@@ -16,8 +16,12 @@
  */
 package org.apache.cocoon.environment.impl;
 
+import java.io.BufferedReader;
+import java.io.IOException;
 import java.util.Map;
 
+import javax.servlet.RequestDispatcher;
+
 import org.apache.cocoon.environment.Request;
 
 /**
@@ -28,15 +32,109 @@
 public abstract class AbstractRequest 
     implements Request {
 
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getAttributes()
+     */
     public Map getAttributes() {
-	return new RequestMap(this);
+        return new RequestMap(this);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getParameters()
+     */
     public Map getParameters() {
-	return new RequestParameterMap(this);
+        return new RequestParameterMap(this);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getHeaders()
+     */
     public Map getHeaders() {
-	return new RequestHeaderMap(this);
+        return new RequestHeaderMap(this);
+    }
+    
+    public int getIntHeader(String name) {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getRequestURL()
+     */
+    public StringBuffer getRequestURL() {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocalAddr()
+     */
+    public String getLocalAddr() {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocalName()
+     */
+    public String getLocalName() {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocalPort()
+     */
+    public int getLocalPort() {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getParameterMap()
+     */
+    public Map getParameterMap() {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRemotePort()
+     */
+    public int getRemotePort() {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrl()
+     */
+    public boolean isRequestedSessionIdFromUrl() {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getReader()
+     */
+    public BufferedReader getReader() throws IOException {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRealPath(java.lang.String)
+     */
+    public String getRealPath(String path) {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRequestDispatcher(java.lang.String)
+     */
+    public RequestDispatcher getRequestDispatcher(String path) {
+        // TODO The method was added when Request was made extending HttpServletRequest, implement the method
+        throw new UnsupportedOperationException();
     }
 }

Added: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractResponse.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractResponse.java?view=auto&rev=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractResponse.java (added)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractResponse.java Mon Aug 13 12:37:10 2007
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.environment.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletOutputStream;
+
+import org.apache.cocoon.environment.Response;
+
+/**
+ * Base class for any response
+ *
+ * @version $Id$
+ */
+public abstract class AbstractResponse 
+    implements Response {
+
+    public String encodeRedirectURL(String url) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public String encodeRedirectUrl(String url) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public String encodeUrl(String url) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void sendError(int sc) throws IOException {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void sendError(int sc, String msg) throws IOException {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void sendRedirect(String location) throws IOException {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void setStatus(int sc) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void setStatus(int sc, String sm) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void flushBuffer() throws IOException {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public int getBufferSize() {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public String getContentType() {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public ServletOutputStream getOutputStream() throws IOException {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public PrintWriter getWriter() throws IOException {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean isCommitted() {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void reset() {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void resetBuffer() {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void setBufferSize(int size) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void setCharacterEncoding(String charset) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void setContentLength(int len) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public void setContentType(String type) {
+        // TODO The method was added when Response was made extending HttpServletResponse, implement the method
+        throw new UnsupportedOperationException();
+    }
+}

Propchange: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractResponse.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractSession.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractSession.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractSession.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/impl/AbstractSession.java Mon Aug 13 12:37:10 2007
@@ -18,6 +18,9 @@
 
 import java.util.Map;
 
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSessionContext;
+
 import org.apache.cocoon.environment.Session;
 
 /**
@@ -30,5 +33,35 @@
 
     public Map getAttributes() {
 	return new SessionMap(this);
+    }
+
+    public ServletContext getServletContext() {
+        // TODO The method was added when Session was made extending HttpSession, implement the method
+        throw new UnsupportedOperationException();
+    }
+
+    public HttpSessionContext getSessionContext() {
+        // TODO Deprecated method that was added when Session was made extending HttpSession, should it be implemented?
+        throw new UnsupportedOperationException();
+    }
+
+    public Object getValue(String name) {
+        // TODO Deprecated method that was added when Session was made extending HttpSession, should it be implemented?
+        throw new UnsupportedOperationException();
+    }
+
+    public String[] getValueNames() {
+        // TODO Deprecated method that was added when Session was made extending HttpSession, should it be implemented?
+        throw new UnsupportedOperationException();
+    }
+
+    public void putValue(String name, Object value) {
+        // TODO Deprecated method that was added when Session was made extending HttpSession, should it be implemented?
+        throw new UnsupportedOperationException();
+    }
+
+    public void removeValue(String name) {
+        // TODO Deprecated method that was added when Session was made extending HttpSession, should it be implemented?
+        throw new UnsupportedOperationException();
     }
 }

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/AbstractRequestWrapper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/AbstractRequestWrapper.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/AbstractRequestWrapper.java (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/AbstractRequestWrapper.java Mon Aug 13 12:37:10 2007
@@ -16,13 +16,17 @@
  */
 package org.apache.cocoon.environment.wrapper;
 
+import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStream;
 import java.security.Principal;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpSession;
+
 import org.apache.cocoon.environment.Cookie;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.Session;
@@ -200,7 +204,7 @@
     /* (non-Javadoc)
      * @see org.apache.cocoon.environment.Request#getCookies()
      */
-    public Cookie[] getCookies() {
+    public javax.servlet.http.Cookie[] getCookies() {
         return this.req.getCookies();
     }
 
@@ -242,7 +246,7 @@
 	/* (non-Javadoc)
 	 * @see org.apache.cocoon.environment.Request#getInputStream()
 	 */
-	public InputStream getInputStream() throws IOException, UnsupportedOperationException {
+	public ServletInputStream getInputStream() throws IOException, UnsupportedOperationException {
 		return this.req.getInputStream();
 	}
 
@@ -326,14 +330,14 @@
     /* (non-Javadoc)
      * @see org.apache.cocoon.environment.Request#getSession(boolean)
      */
-    public Session getSession(boolean create) {
+    public HttpSession getSession(boolean create) {
         return this.req.getSession(create);
     }
 
     /* (non-Javadoc)
      * @see org.apache.cocoon.environment.Request#getSession()
      */
-    public Session getSession() {
+    public HttpSession getSession() {
         return this.req.getSession();
     }
 
@@ -419,6 +423,111 @@
      */
     public Object searchAttribute(String name) {
         return this.req.searchAttribute(name);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getCocoonCookieMap()
+     */
+    public Map getCocoonCookieMap() {
+        return this.req.getCocoonCookieMap();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getCocoonCookies()
+     */
+    public Cookie[] getCocoonCookies() {
+        return this.req.getCocoonCookies();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getCocoonSession(boolean)
+     */
+    public Session getCocoonSession(boolean create) {
+        return this.req.getCocoonSession(create);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.environment.Request#getCocoonSession()
+     */
+    public Session getCocoonSession() {
+        return this.req.getCocoonSession();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getIntHeader(java.lang.String)
+     */
+    public int getIntHeader(String name) {
+        return this.req.getIntHeader(name);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getRequestURL()
+     */
+    public StringBuffer getRequestURL() {
+        return this.req.getRequestURL();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrl()
+     */
+    public boolean isRequestedSessionIdFromUrl() {
+        return this.req.isRequestedSessionIdFromUrl();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocalAddr()
+     */
+    public String getLocalAddr() {
+        return this.req.getLocalAddr();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocalName()
+     */
+    public String getLocalName() {
+        return this.req.getLocalName();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocalPort()
+     */
+    public int getLocalPort() {
+        return this.req.getLocalPort();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getParameterMap()
+     */
+    public Map getParameterMap() {
+        return this.req.getParameterMap();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getReader()
+     */
+    public BufferedReader getReader() throws IOException {
+        return this.req.getReader();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRealPath(java.lang.String)
+     */
+    public String getRealPath(String path) {
+        return this.req.getRealPath(path);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRemotePort()
+     */
+    public int getRemotePort() {
+        return this.req.getRemotePort();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRequestDispatcher(java.lang.String)
+     */
+    public RequestDispatcher getRequestDispatcher(String path) {
+        return this.req.getRequestDispatcher(path);
     }
 
 }

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java?view=diff&rev=565482&r1=565481&r2=565482
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java Mon Aug 13 12:37:10 2007
@@ -20,13 +20,14 @@
 
 import org.apache.cocoon.environment.Cookie;
 import org.apache.cocoon.environment.Response;
+import org.apache.cocoon.environment.impl.AbstractResponse;
 
 /**
  * This is a wrapper class for the Response object.
  * It contains the same properties as the wrapped instance
  * but swallows calls that would modify response headers.
  */
-public class ResponseWrapper implements Response {
+public class ResponseWrapper extends AbstractResponse implements Response {
 
     private Response res;
     
@@ -46,8 +47,16 @@
         return res.getLocale();
     }
 
-    public Cookie createCookie(String name, String value) {
+    public javax.servlet.http.Cookie createCookie(String name, String value) {
         return res.createCookie(name, value);
+    }
+
+    public void addCookie(javax.servlet.http.Cookie cookie) {
+        res.addCookie(cookie);
+    }
+
+    public Cookie createCocoonCookie(String name, String value) {
+        return res.createCocoonCookie(name, value);
     }
 
     public void addCookie(Cookie cookie) {



Mime
View raw message