Author: adrianc
Date: Thu Oct 24 04:47:12 2013
New Revision: 1535276

URL: http://svn.apache.org/r1535276
Log:
Fixed a bug in RequestHandler.java that threw an exception when the servlet is 
mapped to /.

Modified:
    
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Modified: 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1535276&r1=1535275&r2=1535276&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java 
(original)
+++ 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java 
Thu Oct 24 04:47:12 2013
@@ -868,7 +868,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().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 + "/")) {


Reply via email to