You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2009/04/26 07:36:24 UTC

svn commit: r768658 - /wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java

Author: ivaynberg
Date: Sun Apr 26 05:36:23 2009
New Revision: 768658

URL: http://svn.apache.org/viewvc?rev=768658&view=rev
Log:
fix for WICKET-2180 WicketSessionFilter assumes that the WicketFilter has already been inited
Issue: WICKET-2180

Modified:
    wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java

Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java?rev=768658&r1=768657&r2=768658&view=diff
==============================================================================
--- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java (original)
+++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java Sun Apr 26 05:36:23 2009
@@ -138,13 +138,7 @@
 			log.debug("filterName/ application key set to " + filterName);
 		}
 
-		WebApplication application = (WebApplication)Application.get(filterName);
-		sessionKey = application.getSessionAttributePrefix(null) + Session.SESSION_ATTRIBUTE_NAME;
 
-		if (log.isDebugEnabled())
-		{
-			log.debug("will use " + sessionKey + " as the session key to get the Wicket session");
-		}
 	}
 
 	/**
@@ -158,6 +152,19 @@
 		HttpSession httpSession = httpServletRequest.getSession(false);
 		if (httpSession != null)
 		{
+			if (sessionKey == null)
+			{
+				WebApplication application = (WebApplication)Application.get(filterName);
+				sessionKey = application.getSessionAttributePrefix(null) +
+					Session.SESSION_ATTRIBUTE_NAME;
+
+				if (log.isDebugEnabled())
+				{
+					log.debug("will use " + sessionKey +
+						" as the session key to get the Wicket session");
+				}
+			}
+
 			Session session = (Session)httpSession.getAttribute(sessionKey);
 			if (session != null)
 			{