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. CatalogUrlFilter org.ofbiz.product.category.CatalogUrlFilter defaultLocaleStringen_US - redirectUrl/control/main ContentUrlFilter @@ -73,7 +72,6 @@ under the License. defaultLocaleString en_US - redirectUrl/control/main viewRequestViewBlogArticle @@ -88,14 +86,6 @@ under the License. allowedPaths /error:/control:/products:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images - - errorCode - 403 - - - redirectPath - /control/main - CatalogUrlFilter @@ -110,6 +100,11 @@ under the License. /* + + 404 + /error/404.jsp + + org.ofbiz.webapp.control.ControlEventListener 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. +--%> + + +Error 404 + +

+404. +That's an error. +

+

+The requested URL +<%=request.getAttribute("filterRequestUriError")%> +was not found on this server. +That's all we know. +

+ + \ 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