svn commit: r1557118 - /ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1557118 - /ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

adrianc
Author: adrianc
Date: Fri Jan 10 13:29:56 2014
New Revision: 1557118

URL: http://svn.apache.org/r1557118
Log:
Fixed an IndexOutOfBoundsException in RequestHandler.java. Patch supplied by Ritu Raj Lakhera - https://issues.apache.org/jira/browse/OFBIZ-5471.

Modified:
    ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Modified: ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1557118&r1=1557117&r2=1557118&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/branches/release12.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Fri Jan 10 13:29:56 2014
@@ -758,7 +758,10 @@ 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().substring(1);
+        String servletName = req.getServletPath();
+        if (servletName.startsWith("/")) {
+            servletName = servletName.substring(1);
+        }
 
         if (Debug.infoOn()) Debug.logInfo("Rendering View [" + view + "], sessionId=" + UtilHttp.getSessionId(req), module);
         if (view.startsWith(servletName + "/")) {