Author: jacopoc
Date: Thu Sep 15 15:35:05 2016 New Revision: 1760949 URL: http://svn.apache.org/viewvc?rev=1760949&view=rev Log: Improved: modified classes to use the FORWARDED_FROM_SERVLET constant defined in the new ControlFilter class. The old constant defined in ContextFilter will soon be removed together with the debug field, that is not currently used. Modified: ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/JspViewHandler.java ofbiz/trunk/specialpurpose/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java Modified: ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java?rev=1760949&r1=1760948&r2=1760949&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java (original) +++ ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java Thu Sep 15 15:35:05 2016 @@ -59,6 +59,7 @@ import org.apache.ofbiz.service.LocalDis import org.apache.ofbiz.webapp.control.ConfigXMLReader; import org.apache.ofbiz.webapp.control.ConfigXMLReader.ControllerConfig; import org.apache.ofbiz.webapp.control.ContextFilter; +import org.apache.ofbiz.webapp.control.ControlFilter; import org.apache.ofbiz.webapp.control.WebAppConfigurationException; import org.apache.ofbiz.webapp.website.WebSiteWorker; @@ -178,16 +179,13 @@ public class SeoContextFilter extends Co // test to see if we have come through the control servlet already, if not do the processing String requestPath = null; String contextUri = null; - if (httpRequest.getAttribute(ContextFilter.FORWARDED_FROM_SERVLET) == null) { - // Debug.logInfo("In ContextFilter.doFilter, FORWARDED_FROM_SERVLET is NOT set", module); + if (httpRequest.getAttribute(ControlFilter.FORWARDED_FROM_SERVLET) == null) { String allowedPath = config.getInitParameter("allowedPaths"); String redirectPath = config.getInitParameter("redirectPath"); String errorCode = config.getInitParameter("errorCode"); List<String> allowList = StringUtil.split(allowedPath, ":"); - if (debug) Debug.logInfo("[Domain]: " + httpRequest.getServerName() + " [Request]: " + httpRequest.getRequestURI(), module); - requestPath = httpRequest.getServletPath(); if (requestPath == null) requestPath = ""; if (requestPath.lastIndexOf("/") > 0) { Modified: ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java?rev=1760949&r1=1760948&r2=1760949&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java (original) +++ ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlServlet.java Thu Sep 15 15:35:05 2016 @@ -202,7 +202,7 @@ public class ControlServlet extends Http } // some containers call filters on EVERY request, even forwarded ones, so let it know that it came from the control servlet - request.setAttribute(ContextFilter.FORWARDED_FROM_SERVLET, Boolean.TRUE); + request.setAttribute(ControlFilter.FORWARDED_FROM_SERVLET, Boolean.TRUE); String errorPage = null; try { Modified: ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/JspViewHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/JspViewHandler.java?rev=1760949&r1=1760948&r2=1760949&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/JspViewHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/view/JspViewHandler.java Thu Sep 15 15:35:05 2016 @@ -28,7 +28,7 @@ import javax.servlet.jsp.JspException; import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilValidate; -import org.apache.ofbiz.webapp.control.ContextFilter; +import org.apache.ofbiz.webapp.control.ControlFilter; /** * JspViewHandler - Java Server Pages View Handler @@ -58,7 +58,7 @@ public class JspViewHandler extends Abst //Debug.logInfo("Physical Path : " + context.getRealPath(page)); // tell the ContextFilter we are forwarding - request.setAttribute(ContextFilter.FORWARDED_FROM_SERVLET, Boolean.TRUE); + request.setAttribute(ControlFilter.FORWARDED_FROM_SERVLET, Boolean.TRUE); RequestDispatcher rd = request.getRequestDispatcher(page); if (rd == null) { Modified: ofbiz/trunk/specialpurpose/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java?rev=1760949&r1=1760948&r2=1760949&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java (original) +++ ofbiz/trunk/specialpurpose/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/webapp/view/JspViewHandler.java Thu Sep 15 15:35:05 2016 @@ -30,7 +30,7 @@ import javax.servlet.jsp.JspException; import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilValidate; -import org.apache.ofbiz.webapp.control.ContextFilter; +import org.apache.ofbiz.webapp.control.ControlFilter; import org.apache.ofbiz.webapp.view.AbstractViewHandler; import org.apache.ofbiz.webapp.view.ViewHandlerException; @@ -62,7 +62,7 @@ public class JspViewHandler extends Abst // Debug.logInfo("Physical Path : " + context.getRealPath(page)); // tell the ContextFilter we are forwarding - request.setAttribute(ContextFilter.FORWARDED_FROM_SERVLET, Boolean.TRUE); + request.setAttribute(ControlFilter.FORWARDED_FROM_SERVLET, Boolean.TRUE); RequestDispatcher rd = request.getRequestDispatcher(page); if (rd == null) { |
Free forum by Nabble | Edit this page |