svn commit: r1131396 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1131396 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java

jleroux@apache.org
Author: jleroux
Date: Sat Jun  4 13:37:52 2011
New Revision: 1131396

URL: http://svn.apache.org/viewvc?rev=1131396&view=rev
Log:
Revert r948761 I introduced for https://issues.apache.org/jira/browse/OFBIZ-3784.

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java?rev=1131396&r1=1131395&r2=1131396&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java Sat Jun  4 13:37:52 2011
@@ -18,17 +18,11 @@
  *******************************************************************************/
 package org.ofbiz.webapp.website;
 
-import java.util.Map;
-
 import javax.servlet.ServletContext;
 import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
 
 import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
@@ -41,29 +35,10 @@ public class WebSiteWorker {
     public static final String module = WebSiteWorker.class.getName();
 
     public static String getWebSiteId(ServletRequest request) {
-        HttpSession session = ((HttpServletRequest) request).getSession();
-        Map<String, Object> requestParameters = UtilHttp.getParameterMap((HttpServletRequest) request);
-        String webSiteId = null;
-        boolean fromSession = false;
-
-        // first see if a new webSiteId was specified as a parameter
-        webSiteId = (String) requestParameters.get("webSiteId");
-        // if no parameter, try from session
-        if (UtilValidate.isEmpty(webSiteId)) {
-            webSiteId = (String) session.getAttribute("webSiteId");
-            if (webSiteId != null) fromSession = true;
-        }
-        // get it from the servlet context
-        if (UtilValidate.isEmpty(webSiteId)) {
-            ServletContext application = ((ServletContext) request.getAttribute("servletContext"));
-            if (application != null) webSiteId = application.getInitParameter("webSiteId");
-        }
-
-        if (UtilValidate.isNotEmpty(webSiteId) && !fromSession) {
-            session.setAttribute("webSiteId", webSiteId);
-        }
+        ServletContext application = ((ServletContext) request.getAttribute("servletContext"));
 
-        return webSiteId;
+        if (application == null) return null;
+        return application.getInitParameter("webSiteId");
     }
 
     public static GenericValue getWebSite(ServletRequest request) {