Author: jleroux
Date: Thu Jun 17 15:18:48 2010
New Revision: 955631
URL: http://svn.apache.org/viewvc?rev=955631&view=rev
Log:
A patch from Sascha Rodekamp "Set webside Id in context filter"
(https://issues.apache.org/jira/browse/OFBIZ-3801) - OFBIZ-3801
Very minor: a better way to write the webSiteId in the Session (2d try ;o)
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=955631&r1=955630&r2=955631&view=diff
==============================================================================
---
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
(original)
+++
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
Thu Jun 17 15:18:48 2010
@@ -62,7 +62,6 @@ import org.ofbiz.security.authz.Authoriz
import org.ofbiz.security.authz.AuthorizationFactory;
import org.ofbiz.service.GenericDispatcher;
import org.ofbiz.service.LocalDispatcher;
-import org.ofbiz.webapp.website.WebSiteWorker;
/**
* ContextFilter - Restricts access to raw files and configures servlet
objects.
@@ -134,12 +133,14 @@ public class ContextFilter implements Fi
Thread.currentThread().setContextClassLoader(localCachedClassLoader);
}
- // set the webSiteId in the session
- httpRequest.getSession().setAttribute("webSiteId",
WebSiteWorker.getWebSiteId(httpRequest));
-
// set the ServletContext in the request for future use
request.setAttribute("servletContext", config.getServletContext());
+ // set the webSiteId in the session
+ if
(UtilValidate.isEmpty(httpRequest.getSession().getAttribute("webSiteId"))){
+ httpRequest.getSession().setAttribute("webSiteId",
config.getServletContext().getAttribute("webSiteId"));
+ }
+
// set the filesystem path of context root.
request.setAttribute("_CONTEXT_ROOT_",
config.getServletContext().getRealPath("/"));