Author: tschneider
Date: Sat Nov 24 11:08:26 2007
New Revision: 597904

URL: http://svn.apache.org/viewvc?rev=597904&view=rev
Log:
WW-2328 fix for DefaultActionMapper not parsing out the sessionid

Submitted By: Omkar Patil
Reviewed By: Tom Schneider


Modified:
    
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
    
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java?rev=597904&r1=597903&r2=597904&view=diff
==============================================================================
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
 Sat Nov 24 11:08:26 2007
@@ -289,7 +289,10 @@
             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;

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java?rev=597904&r1=597903&r2=597904&view=diff
==============================================================================
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
 Sat Nov 24 11:08:26 2007
@@ -181,6 +181,18 @@
         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());


Reply via email to