diff --git a/applications/content/src/org/ofbiz/content/cms/CmsEvents.java b/applications/content/src/org/ofbiz/content/cms/CmsEvents.java index 51447d4372..48edb2b93e 100644 --- a/applications/content/src/org/ofbiz/content/cms/CmsEvents.java +++ b/applications/content/src/org/ofbiz/content/cms/CmsEvents.java @@ -78,7 +78,10 @@ public class CmsEvents { // is this a default request or called from a defined request mapping String targetRequest = (String) request.getAttribute("targetRequestUri"); + Debug.logInfo("The targetRequest is " + targetRequest , module); String actualRequest = (String) request.getAttribute("thisRequestUri"); + Debug.logInfo("The actualRequest is " + actualRequest , module); + if (targetRequest != null) { targetRequest = targetRequest.replaceAll("\\W", ""); } else { @@ -102,6 +105,7 @@ public class CmsEvents { pathInfo = overrideViewUri; } else { pathInfo = request.getPathInfo(); + Debug.logInfo("The pathInfo is " + actualRequest , module); if (targetRequest.equals(actualRequest) && pathInfo != null) { // was called directly -- path info is everything after the request String[] pathParsed = pathInfo.split("/", 3); @@ -155,7 +159,7 @@ public class CmsEvents { if (!alias.startsWith("/")) { alias = "/" + alias; } - + Debug.logInfo("WebPathAlias is set to " + alias , module); RequestDispatcher rd = request.getRequestDispatcher(request.getServletPath() + alias); try { rd.forward(request, response); @@ -175,6 +179,9 @@ public class CmsEvents { Locale locale = UtilHttp.getLocale(request); // get the contentId/mapKey from URL + + // If webpathalias is valid then system will never look for content id or mapKey. + if (contentId == null) { if (Debug.verboseOn()) Debug.logVerbose("Current PathInfo: " + pathInfo, module); String[] pathSplit = pathInfo.split("/"); @@ -268,8 +275,6 @@ public class CmsEvents { // TODO: replace "screen" to support dynamic rendering of different output FormStringRenderer formStringRenderer = new MacroFormRenderer(UtilProperties.getPropertyValue("widget", "screen.formrenderer"), request, response); templateMap.put("formStringRenderer", formStringRenderer); - //include DOCTYPE for cms screens - writer.append(""); // if use web analytics List webAnalytics = delegator.findByAnd("WebAnalyticsConfig", UtilMisc.toMap("webSiteId", webSiteId), null, false);