From d3a58f3ee403bc43df2b5191f08268e64f7bddec Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Wed, 28 Jan 2015 15:41:07 +0000 Subject: [PATCH] Commits small RequestHandler.java changes after r1535432 (related with OFBIZ-5312) This is in preparation of the SEO branch merging, still WIP but should be soon git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1655367 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/ofbiz/webapp/control/RequestHandler.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java b/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java index ad02bdc6f6..6e8546cc37 100644 --- a/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java +++ b/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java @@ -862,7 +862,7 @@ public class RequestHandler { } private void renderView(String view, boolean allowExtView, HttpServletRequest req, HttpServletResponse resp, String saveName) throws RequestHandlerException { GenericValue userLogin = (GenericValue) req.getSession().getAttribute("userLogin"); - // workaraound if we are in the root webapp + // workaround if we are in the root webapp String cname = UtilHttp.getApplicationName(req); String oldView = view; @@ -873,12 +873,11 @@ public class RequestHandler { // if the view name starts with the control servlet name and a /, then it was an // attempt to override the default view with a call back into the control servlet, // so just get the target view name and use that - String servletName = req.getServletPath(); - if (servletName.startsWith("/")) { + if (UtilValidate.isNotEmpty(servletName) && servletName.length() > 1 || servletName.startsWith("/")) { servletName = servletName.substring(1); } - + if (Debug.infoOn()) Debug.logInfo("Rendering View [" + view + "], sessionId=" + UtilHttp.getSessionId(req), module); if (view.startsWith(servletName + "/")) { view = view.substring(servletName.length() + 1);