From: Chris L. <chr...@jb...> - 2006-07-04 21:05:55
|
User: claprun Date: 06/07/04 17:05:52 Modified: wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet SessionInterceptor.java Log: - Fixed session handling in SessionInterceptor. Producer tests now pass. - Moved fault creation methods to WSRPUtils. Revision Changes Path 1.4 +9 -4 jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet/SessionInterceptor.java (In the diff below, changes in quantity of whitespace are not shown.) Index: SessionInterceptor.java =================================================================== RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet/SessionInterceptor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- SessionInterceptor.java 26 May 2006 22:27:10 -0000 1.3 +++ SessionInterceptor.java 4 Jul 2006 21:05:52 -0000 1.4 @@ -25,6 +25,7 @@ import org.jboss.portal.portlet.invocation.PortletInterceptor; import org.jboss.portal.portlet.invocation.PortletInvocation; import org.jboss.portal.wsrp.WSRPProducer; +import org.jboss.portal.wsrp.core.InvalidSessionFault; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -33,7 +34,7 @@ * Implements session handling for WSRP. * * @author <a href="mailto:chr...@jb...">Chris Laprun</a> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * @since 2.4 */ public class SessionInterceptor extends PortletInterceptor @@ -54,13 +55,17 @@ // we need to deal with the session id if (sessionId != null) { - // we originally didn't have a session id, so the portlet to which this invocation was dispatched interacted - // with session, we need to inform MarkupHandler - if (previousSessionId == null) + // we originally didn't have a session id or the previous session id is the same as the current one, so the + // portlet to which this invocation was dispatched interacted with session, we need to inform MarkupHandler + if (previousSessionId == null || sessionId.equals(previousSessionId)) { invocation.setAttribute(WSRPProducer.SESSION_ID_ATTRIBUTE, sessionId); invocation.setAttribute(WSRPProducer.SESSION_ATTRIBUTE, session); } + else + { + throw new InvalidSessionFault(); + } } } |