You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Thai Ha (JIRA)" <ji...@apache.org> on 2007/11/18 13:03:33 UTC

[jira] Created: (WW-2328) Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy

Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy
-------------------------------------------------------------------------------------

                 Key: WW-2328
                 URL: https://issues.apache.org/struts/browse/WW-2328
             Project: Struts 2
          Issue Type: Bug
          Components: Dispatch Filter
    Affects Versions: 2.1.x
         Environment: Windows XP, JDK 1.5, maven 2.0.7, Jetty 6.1.5, Struts 2.1.1-SNAPSHOT
            Reporter: Thai Ha


Scenario:
When the URL has the format of (xxx.action;jsessionid=yyy), the corresponding action mapping cannot be found by Dispatch Filter, as a result, the error 404 is returned. This error happens on Struts 2.1.1-SNAPSHOT, but not happens on Struts 2.0.x.

Root cause:
>From the SVN history, I see the change at http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/RequestUtils.java (revision 586739) makes the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) (if any) in the result. And the Dispatch Filter doesn't remove the path parameters before lookup action mapping. So if the request contains path parameters like (;jsessionid=), the action mapping will not be found, and the error 404 will be returned.





-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2328) Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy

Posted by "Thai Ha (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thai Ha updated WW-2328:
------------------------

    Attachment: sample.zip

To duplicate the error:
1. Install JDK 1.5, Maven 2.0.x
2. Unzip sample.zip
3. Execute command "mvn jetty:run" in the unzipped sample/ directory
4. Open Internet Explorer and access http://localhost:8080/index.jsp
5. Click on hyperlink "List", the error 404 is displayed

> Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy
> -------------------------------------------------------------------------------------
>
>                 Key: WW-2328
>                 URL: https://issues.apache.org/struts/browse/WW-2328
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.x
>         Environment: Windows XP, JDK 1.5, maven 2.0.7, Jetty 6.1.5, Struts 2.1.1-SNAPSHOT
>            Reporter: Thai Ha
>         Attachments: sample.zip
>
>
> Scenario:
> When the URL has the format of (xxx.action;jsessionid=yyy), the corresponding action mapping cannot be found by Dispatch Filter, as a result, the error 404 is returned. This error happens on Struts 2.1.1-SNAPSHOT, but not happens on Struts 2.0.x.
> Root cause:
> From the SVN history, I see the change at http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/RequestUtils.java (revision 586739) makes the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) (if any) in the result. And the Dispatch Filter doesn't remove the path parameters before lookup action mapping. So if the request contains path parameters like (;jsessionid=), the action mapping will not be found, and the error 404 will be returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2328) Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy

Posted by "Omkar Patil (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42691 ] 

Omkar Patil commented on WW-2328:
---------------------------------

After revision 586739, as the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) in the result,  the getMapping method in DefaultActionMapper is returning null. Here is the code snippet from that method where it all happens -

    String uri = getUri(request);
    uri = dropExtension(uri, mapping);
    if (uri == null) {
        return null;
    }

The getUri method internally calls the RequestUtils.getServletPath method and as a result receives uri with path parameters still on.The dropExtension method just checks if the uri passed in ends with action extension, and strips the extension if present. 

Possible fix would be once the uri is returned from getUri call, we can strip off the the extra information such as path parameters from it and then pass it into the dropExtension method. With this fix we can avoid making changes to the RequestUtils.getServletPath(HttpServletRequest) method as it may have been used by other parts of the code which expect the uri with path parameters as well.

I can provide a patch for this in couple of days.

> Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy
> -------------------------------------------------------------------------------------
>
>                 Key: WW-2328
>                 URL: https://issues.apache.org/struts/browse/WW-2328
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.x
>         Environment: Windows XP, JDK 1.5, maven 2.0.7, Jetty 6.1.5, Struts 2.1.1-SNAPSHOT
>            Reporter: Thai Ha
>            Priority: Blocker
>             Fix For: 2.1.1
>
>         Attachments: sample.zip
>
>
> Scenario:
> When the URL has the format of (xxx.action;jsessionid=yyy), the corresponding action mapping cannot be found by Dispatch Filter, as a result, the error 404 is returned. This error happens on Struts 2.1.1-SNAPSHOT, but not happens on Struts 2.0.x.
> Root cause:
> From the SVN history, I see the change at http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/RequestUtils.java (revision 586739) makes the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) (if any) in the result. And the Dispatch Filter doesn't remove the path parameters before lookup action mapping. So if the request contains path parameters like (;jsessionid=), the action mapping will not be found, and the error 404 will be returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2328) Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy

Posted by "Omkar Patil (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42701 ] 

Omkar Patil commented on WW-2328:
---------------------------------

The patch includes a testcase too.

> Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy
> -------------------------------------------------------------------------------------
>
>                 Key: WW-2328
>                 URL: https://issues.apache.org/struts/browse/WW-2328
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.x
>         Environment: Windows XP, JDK 1.5, maven 2.0.7, Jetty 6.1.5, Struts 2.1.1-SNAPSHOT
>            Reporter: Thai Ha
>            Priority: Blocker
>             Fix For: 2.1.1
>
>         Attachments: patch.txt, sample.zip
>
>
> Scenario:
> When the URL has the format of (xxx.action;jsessionid=yyy), the corresponding action mapping cannot be found by Dispatch Filter, as a result, the error 404 is returned. This error happens on Struts 2.1.1-SNAPSHOT, but not happens on Struts 2.0.x.
> Root cause:
> From the SVN history, I see the change at http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/RequestUtils.java (revision 586739) makes the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) (if any) in the result. And the Dispatch Filter doesn't remove the path parameters before lookup action mapping. So if the request contains path parameters like (;jsessionid=), the action mapping will not be found, and the error 404 will be returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2328) Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy

Posted by "Omkar Patil (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Omkar Patil updated WW-2328:
----------------------------

    Attachment: patch.txt

Here is the patch for it.

> Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy
> -------------------------------------------------------------------------------------
>
>                 Key: WW-2328
>                 URL: https://issues.apache.org/struts/browse/WW-2328
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.x
>         Environment: Windows XP, JDK 1.5, maven 2.0.7, Jetty 6.1.5, Struts 2.1.1-SNAPSHOT
>            Reporter: Thai Ha
>            Priority: Blocker
>             Fix For: 2.1.1
>
>         Attachments: patch.txt, sample.zip
>
>
> Scenario:
> When the URL has the format of (xxx.action;jsessionid=yyy), the corresponding action mapping cannot be found by Dispatch Filter, as a result, the error 404 is returned. This error happens on Struts 2.1.1-SNAPSHOT, but not happens on Struts 2.0.x.
> Root cause:
> From the SVN history, I see the change at http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/RequestUtils.java (revision 586739) makes the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) (if any) in the result. And the Dispatch Filter doesn't remove the path parameters before lookup action mapping. So if the request contains path parameters like (;jsessionid=), the action mapping will not be found, and the error 404 will be returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2328) Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2328:
--------------------------

         Priority: Blocker  (was: Major)
    Fix Version/s: 2.1.1

I want to make sure we address this before the next release.

> Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy
> -------------------------------------------------------------------------------------
>
>                 Key: WW-2328
>                 URL: https://issues.apache.org/struts/browse/WW-2328
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.x
>         Environment: Windows XP, JDK 1.5, maven 2.0.7, Jetty 6.1.5, Struts 2.1.1-SNAPSHOT
>            Reporter: Thai Ha
>            Priority: Blocker
>             Fix For: 2.1.1
>
>         Attachments: sample.zip
>
>
> Scenario:
> When the URL has the format of (xxx.action;jsessionid=yyy), the corresponding action mapping cannot be found by Dispatch Filter, as a result, the error 404 is returned. This error happens on Struts 2.1.1-SNAPSHOT, but not happens on Struts 2.0.x.
> Root cause:
> From the SVN history, I see the change at http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/RequestUtils.java (revision 586739) makes the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) (if any) in the result. And the Dispatch Filter doesn't remove the path parameters before lookup action mapping. So if the request contains path parameters like (;jsessionid=), the action mapping will not be found, and the error 404 will be returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2328) Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy

Posted by "Tom Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom Schneider resolved WW-2328.
-------------------------------

    Resolution: Fixed
      Assignee: Tom Schneider

Thanks for the patch!  I've reviewed and applied the patch.

> Server returns 404 error when the action URL has the format xxx.action;jsessionid=yyy
> -------------------------------------------------------------------------------------
>
>                 Key: WW-2328
>                 URL: https://issues.apache.org/struts/browse/WW-2328
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.x
>         Environment: Windows XP, JDK 1.5, maven 2.0.7, Jetty 6.1.5, Struts 2.1.1-SNAPSHOT
>            Reporter: Thai Ha
>            Assignee: Tom Schneider
>            Priority: Blocker
>             Fix For: 2.1.1
>
>         Attachments: patch.txt, sample.zip
>
>
> Scenario:
> When the URL has the format of (xxx.action;jsessionid=yyy), the corresponding action mapping cannot be found by Dispatch Filter, as a result, the error 404 is returned. This error happens on Struts 2.1.1-SNAPSHOT, but not happens on Struts 2.0.x.
> Root cause:
> From the SVN history, I see the change at http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/RequestUtils.java (revision 586739) makes the method RequestUtils.getServletPath(HttpServletRequest) returns the path parameters (like ;jsessionid=yyy) (if any) in the result. And the Dispatch Filter doesn't remove the path parameters before lookup action mapping. So if the request contains path parameters like (;jsessionid=), the action mapping will not be found, and the error 404 will be returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.