cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/environment/http HttpRequest.java HttpSession.java
Date Fri, 06 Dec 2002 10:33:00 GMT
cziegeler    2002/12/06 02:33:00

  Modified:    src/java/org/apache/cocoon/environment/http Tag:
                        cocoon_2_0_3_branch HttpRequest.java
                        HttpSession.java
  Log:
  Fixing invalidation bug
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.7   +13 -4     xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpRequest.java
  
  Index: HttpRequest.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpRequest.java,v
  retrieving revision 1.6.2.6
  retrieving revision 1.6.2.7
  diff -u -r1.6.2.6 -r1.6.2.7
  --- HttpRequest.java	5 Dec 2002 14:18:30 -0000	1.6.2.6
  +++ HttpRequest.java	6 Dec 2002 10:33:00 -0000	1.6.2.7
  @@ -224,11 +224,20 @@
       }
   
       public Session getSession(boolean create) {
  -        if ( null == this.session ) {
  -            javax.servlet.http.HttpSession serverSession = this.req.getSession(create);
  -            if( null != serverSession ) {
  +        javax.servlet.http.HttpSession serverSession = this.req.getSession(create);
  +        if ( null != serverSession) {
  +            if ( null != this.session ) {
  +                if ( this.session.wrappedSession != serverSession ) {
  +                    // update wrapper
  +                    this.session.wrappedSession = serverSession;
  +                }
  +            } else {
  +                // new wrapper
                   this.session = new HttpSession( serverSession );
               }
  +        } else {
  +            // invalidate
  +            this.session = null;
           }
           return this.session;
       }
  
  
  
  1.4.2.2   +14 -14    xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpSession.java
  
  Index: HttpSession.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/http/HttpSession.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- HttpSession.java	15 Jul 2002 14:42:49 -0000	1.4.2.1
  +++ HttpSession.java	6 Dec 2002 10:33:00 -0000	1.4.2.2
  @@ -86,13 +86,13 @@
   public final class HttpSession
   implements Session {
   
  -    private javax.servlet.http.HttpSession session;
  +    javax.servlet.http.HttpSession wrappedSession;
   
       /**
        * Construct a new session from an HttpSession
        */
       public HttpSession(javax.servlet.http.HttpSession session) {
  -        this.session = session;
  +        this.wrappedSession = session;
       }
   
       /**
  @@ -110,7 +110,7 @@
        *
        */
       public long getCreationTime() {
  -        return this.session.getCreationTime();
  +        return this.wrappedSession.getCreationTime();
       }
   
       /**
  @@ -127,7 +127,7 @@
        *
        */
       public String getId() {
  -        return this.session.getId();
  +        return this.wrappedSession.getId();
       }
   
       /**
  @@ -152,7 +152,7 @@
        */
   
       public long getLastAccessedTime() {
  -        return this.session.getLastAccessedTime();
  +        return this.wrappedSession.getLastAccessedTime();
       }
   
       /**
  @@ -166,7 +166,7 @@
        *
        */
       public void setMaxInactiveInterval(int interval) {
  -        this.session.setMaxInactiveInterval(interval);
  +        this.wrappedSession.setMaxInactiveInterval(interval);
       }
   
      /**
  @@ -187,7 +187,7 @@
       *
       */
       public int getMaxInactiveInterval() {
  -        return this.session.getMaxInactiveInterval();
  +        return this.wrappedSession.getMaxInactiveInterval();
       }
   
       /**
  @@ -204,7 +204,7 @@
        *
        */
       public Object getAttribute(String name) {
  -        return this.session.getAttribute(name);
  +        return this.wrappedSession.getAttribute(name);
       }
   
       /**
  @@ -222,7 +222,7 @@
        *
        */
       public Enumeration getAttributeNames() {
  -        return this.session.getAttributeNames();
  +        return this.wrappedSession.getAttributeNames();
       }
   
       /**
  @@ -241,7 +241,7 @@
        *
        */
       public void setAttribute(String name, Object value) {
  -        this.session.setAttribute(name, value);
  +        this.wrappedSession.setAttribute(name, value);
       }
   
       /**
  @@ -258,7 +258,7 @@
        *                                        invalidated session
        */
       public void removeAttribute(String name) {
  -        this.session.removeAttribute(name);
  +        this.wrappedSession.removeAttribute(name);
       }
   
       /**
  @@ -271,7 +271,7 @@
        *
        */
       public void invalidate() {
  -        this.session.invalidate();
  +        this.wrappedSession.invalidate();
       }
   
       /**
  @@ -291,7 +291,7 @@
        *
        */
       public boolean isNew() {
  -        return this.session.isNew();
  +        return this.wrappedSession.isNew();
       }
   
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message