[ 
https://issues.apache.org/jira/browse/WW-4585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096659#comment-15096659
 ] 

Rich P Peters, II edited comment on WW-4585 at 1/13/16 5:46 PM:
----------------------------------------------------------------

It was actually turned on earlier in the test suite.  here is the example with 
it turned on in the test:

{code:java}
    public void testGetJsessionIdSemicolonMappingWithMethod() throws Exception {
        
req.setRequestURI("/myapp/animals/dog/fido!update;jsessionid=29fefpv23do1g");
        req.setServletPath("/animals/dog/fido");
        req.setMethod("GET");
        mapper.setAllowDynamicMethodCalls("true");
        ActionMapping mapping = mapper.getMapping(req, configManager);

        assertEquals("/animals", mapping.getNamespace());
        assertEquals("dog", mapping.getName());
        assertEquals("fido", ((String[]) mapping.getParams().get("id"))[0]);
        assertEquals("update", mapping.getMethod());
    }
{code}
results:
{code:java}
junit.framework.ComparisonFailure: null 
Expected :update
Actual   :update;jsessionid=29fefpv23do1g
{code}


was (Author: rpii):
It was actually turned on earlier in the test suite.  here is the example with 
it turned on in the test:

{code:java}
    public void testGetJsessionIdSemicolonMappingWithMethod() throws Exception {
        
req.setRequestURI("/myapp/animals/dog/fido!update;jsessionid=29fefpv23do1g");
        req.setServletPath("/animals/dog/fido");
        req.setMethod("GET");
        mapper.setAllowDynamicMethodCalls("true");
        ActionMapping mapping = mapper.getMapping(req, configManager);

        assertEquals("/animals", mapping.getNamespace());
        assertEquals("dog", mapping.getName());
        assertEquals("fido", ((String[]) mapping.getParams().get("id"))[0]);
        assertEquals("update", mapping.getMethod());
    }
{code}
results:
{code:java}
junit.framework.ComparisonFailure: null 
Expected :update
Actual   :update;jsessionid=29fefpv23do1g
{code

> Struts2 Rest plugin doesnt handle JSESSIONID
> --------------------------------------------
>
>                 Key: WW-4585
>                 URL: https://issues.apache.org/jira/browse/WW-4585
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - REST
>    Affects Versions: 2.3.24
>         Environment: tomcat
>            Reporter: Rich P Peters, II
>            Priority: Blocker
>             Fix For: 2.3.25
>
>
> If a url with a JSESSIONID is sent to a struts2 action, a failure will result
> see this modified unit test from the plugin unit test:
> {code:java}
>     public void testGetJsessionIdSemicolonMapping() throws Exception {
>         req.setRequestURI("/myapp/animals/dog/fido;jsessionid=29fefpv23do1g");
>         req.setServletPath("/animals/dog/fido");
>         req.setMethod("GET");
>         ActionMapping mapping = mapper.getMapping(req, configManager);
>         assertEquals("/animals", mapping.getNamespace());
>         assertEquals("dog", mapping.getName());
>         assertEquals("fido", ((String[]) mapping.getParams().get("id"))[0]);
>         assertEquals("show", mapping.getMethod());
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to