1) Fix issue with servlet based Web Script url encoding - wasn't decoding URL after method used to retrieve url path info was changed.

2) Remove unused imports

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6213 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2007-07-11 17:36:10 +00:00
parent d28d040c59
commit 7ad3e3820e
4 changed files with 21 additions and 11 deletions

View File

@@ -24,6 +24,9 @@
*/
package org.alfresco.web.scripts;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -102,7 +105,14 @@ public class WebScriptServletRuntime extends WebScriptRuntime
// NOTE: Don't use req.getPathInfo() - it truncates the path at first semi-colon in Tomcat
String requestURI = req.getRequestURI();
String pathInfo = requestURI.substring((req.getContextPath() + req.getServletPath()).length());
return pathInfo;
try
{
return URLDecoder.decode(pathInfo, "UTF-8");
}
catch(UnsupportedEncodingException e)
{
throw new WebScriptException("Failed to retrieve path info", e);
}
}
/* (non-Javadoc)