Author: hansbak
Date: Wed Nov 30 09:06:48 2011 New Revision: 1208335 URL: http://svn.apache.org/viewvc?rev=1208335&view=rev Log: Return a 404 error and not redirect to control main in the ecommerce: https://issues.apache.org/jira/browse/OFBIZ-4390 Added: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp (with props) Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml 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=1208335&r1=1208334&r2=1208335&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 Wed Nov 30 09:06:48 2011 @@ -249,7 +249,7 @@ public class ContextFilter implements Fi // check to make sure the requested url is allowed if (!allowList.contains(requestPath) && !allowList.contains(requestInfo) && !allowList.contains(httpRequest.getServletPath())) { String filterMessage = "[Filtered request]: " + contextUri; - + if (redirectPath == null) { int error = 404; if (UtilValidate.isNotEmpty(errorCode)) { @@ -261,6 +261,7 @@ public class ContextFilter implements Fi } filterMessage = filterMessage + " (" + error + ")"; httpResponse.sendError(error, contextUri); + request.setAttribute("filterRequestUriError", contextUri); } else { filterMessage = filterMessage + " (" + redirectPath + ")"; if (!redirectPath.toLowerCase().startsWith("http")) { Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml?rev=1208335&r1=1208334&r2=1208335&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml Wed Nov 30 09:06:48 2011 @@ -63,7 +63,6 @@ under the License. <display-name>CatalogUrlFilter</display-name> <filter-class>org.ofbiz.product.category.CatalogUrlFilter</filter-class> <init-param><param-name>defaultLocaleString</param-name><param-value>en_US</param-value></init-param> - <init-param><param-name>redirectUrl</param-name><param-value>/control/main</param-value></init-param> </filter> <filter> <filter-name>ContentUrlFilter</filter-name> @@ -73,7 +72,6 @@ under the License. <param-name>defaultLocaleString</param-name> <param-value>en_US</param-value> </init-param> - <init-param><param-name>redirectUrl</param-name><param-value>/control/main</param-value></init-param> <init-param><param-name>viewRequest</param-name><param-value>ViewBlogArticle</param-value></init-param> </filter> <filter> @@ -88,14 +86,6 @@ under the License. <param-name>allowedPaths</param-name> <param-value>/error:/control:/products:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images</param-value> </init-param> - <init-param> - <param-name>errorCode</param-name> - <param-value>403</param-value> - </init-param> - <init-param> - <param-name>redirectPath</param-name> - <param-value>/control/main</param-value> - </init-param> </filter> <filter-mapping> <filter-name>CatalogUrlFilter</filter-name> @@ -110,6 +100,11 @@ under the License. <url-pattern>/*</url-pattern> </filter-mapping> + <error-page> + <error-code>404</error-code> + <location>/error/404.jsp</location> + </error-page> + <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener> <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface --> <!-- <listener><listener-class>org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> --> Added: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp?rev=1208335&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp (added) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp Wed Nov 30 09:06:48 2011 @@ -0,0 +1,34 @@ +<%-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--%> +<html> +<head> +<title>Error 404</title> +<body> +<p> +<b>404.</b> +<ins>That's an error.</ins> +</p> +<p> +The requested URL +<code><%=request.getAttribute("filterRequestUriError")%></code> +was not found on this server. +<ins>That's all we know.</ins> +</p> +</body> +</html> \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/error/404.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain |
Free forum by Nabble | Edit this page |