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
This commit is contained in:
Jacques Le Roux
2015-01-28 15:41:07 +00:00
parent 7fe9ad2a9c
commit d3a58f3ee4
@@ -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);