WW-2328 fix for DefaultActionMapper not parsing out the sessionid

Submitted By: Omkar Patil
Reviewed By: Tom Schneider



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@597904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Schneider
2007-11-24 19:08:26 +00:00
parent 2788ac9ab5
commit 6fd129b9ed
2 changed files with 16 additions and 1 deletions
@@ -289,7 +289,10 @@ public class DefaultActionMapper implements ActionMapper {
ConfigurationManager configManager) {
ActionMapping mapping = new ActionMapping();
String uri = getUri(request);
int indexOfSemicolon = uri.indexOf(";");
uri = (indexOfSemicolon > -1) ? uri.substring(0, indexOfSemicolon) : uri;
uri = dropExtension(uri, mapping);
if (uri == null) {
return null;
@@ -181,6 +181,18 @@ public class DefaultActionMapperTest extends StrutsTestCase {
ActionMapping mapping = mapper.getMapping(req, configManager);
assertEquals("/my/namespace/actionName.action", mapper.getUriFromActionMapping(mapping));
}
public void testGetUriWithSemicolonPresent() throws Exception {
req.setupGetParameterMap(new HashMap());
req.setupGetRequestURI("/my/namespace/actionName.action;abc=123rty56");
req.setupGetServletPath("/my/namespace/actionName.action;abc=123rty56");
req.setupGetAttribute(null);
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
DefaultActionMapper mapper = new DefaultActionMapper();
ActionMapping mapping = mapper.getMapping(req, configManager);
assertEquals("/my/namespace/actionName.action", mapper.getUriFromActionMapping(mapping));
}
public void testGetUriWithMethod() throws Exception {
req.setupGetParameterMap(new HashMap());