ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r1701379 - /ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java
Date Sat, 05 Sep 2015 12:29:04 GMT
Author: shijh
Date: Sat Sep  5 12:29:04 2015
New Revision: 1701379

URL: http://svn.apache.org/r1701379
Log:
OFBIZ-6596 The Solr redirection does not work in trunk demo.

Removed https scheme check and demo-trunk-ofbiz.apache.org/solr/ can be displayed correctly
now.

Modified:
    ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java

Modified: ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java?rev=1701379&r1=1701378&r2=1701379&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java
(original)
+++ ofbiz/trunk/specialpurpose/solr/src/org/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java
Sat Sep  5 12:29:04 2015
@@ -26,14 +26,10 @@ import javax.servlet.http.HttpServletRes
 import javax.servlet.http.HttpSession;
 
 import org.apache.solr.servlet.RedirectServlet;
-import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.security.Security;
-import org.ofbiz.webapp.OfbizUrlBuilder;
 import org.ofbiz.webapp.control.LoginWorker;
-import org.ofbiz.webapp.control.WebAppConfigurationException;
 
 /**
  * OFBizSolrRedirectServlet.java - Master servlet for the ofbiz-solr application.
@@ -67,13 +63,13 @@ public class OFBizSolrRedirectServlet ex
             if (security == null) {
                 security = (Security) session.getAttribute("security");
                 if (security != null) {
-                	request.setAttribute("security", security);
+                    request.setAttribute("security", security);
                 }
             }
             if (security == null) {
                 security = (Security) request.getServletContext().getAttribute("security");
                 if (security != null) {
-                	request.setAttribute("security", security);
+                    request.setAttribute("security", security);
                 }
             }
             if (!LoginWorker.hasBasePermission(userLogin, request)) {
@@ -95,38 +91,6 @@ public class OFBizSolrRedirectServlet ex
             return true;
         }
         
-        // check request schema
-//        if (!request.getScheme().equals("https")) {
-//            StringBuilder newURL = new StringBuilder(250);
-//            // Build the scheme and host part
-//            try {
-//                OfbizUrlBuilder builder = OfbizUrlBuilder.from(request);
-//                builder.buildHostPart(newURL, "", true);
-//            } catch (GenericEntityException e) {
-//                // If the entity engine is throwing exceptions, then there is no point
in continuing.
-//                Debug.logError(e, "Exception thrown while getting web site properties:
", module);
-//                return false;
-//            } catch (WebAppConfigurationException e) {
-//                // If we can't read the controller.xml file, then there is no point in
continuing.
-//                Debug.logError(e, "Exception thrown while parsing controller.xml file:
", module);
-//                return false;
-//            } catch (IOException e) {
-//                // If we can't write to StringBuilder, then there is no point in continuing.
-//                Debug.logError(e, "Exception thrown while writing to StringBuilder: ",
module);
-//                return false;
-//            }
-//            newURL.append(request.getRequestURI());
-//
-//            // send the redirect
-//            try {            
-//                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
-//                response.setHeader("Location", newURL.toString());
-//                response.setHeader("Connection", "close");
-//            } catch (IllegalStateException ise) {
-//                throw new IOException(ise.getMessage(), ise);
-//            }
-//            return true;
-//        }
         return false;
     }
 }



Mime
View raw message