cziegeler 2002/12/06 02:34:27 Modified: src/java/org/apache/cocoon/environment/http HttpRequest.java HttpSession.java Log: Fixing invalidation bug Revision Changes Path 1.13 +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.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- HttpRequest.java 5 Dec 2002 14:21:36 -0000 1.12 +++ HttpRequest.java 6 Dec 2002 10:34:27 -0000 1.13 @@ -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.6 +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.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- HttpSession.java 6 Jun 2002 14:28:14 -0000 1.5 +++ HttpSession.java 6 Dec 2002 10:34:27 -0000 1.6 @@ -86,13 +86,13 @@ public final class HttpSession implements Session { - private javax.servlet.http.HttpSession session; + private 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: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]