[ 
http://www.stripesframework.org/jira/browse/STS-899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907#comment-12907
 ] 

Remi VANKEISBELCK commented on STS-899:
---------------------------------------

Just commited an additional test using 
request.getDispatcher(<url_with_%25>).include(req,resp)

See the test app on github :

https://github.com/vankeisb/sts899

File "src/main/webapp/include.jsp" simply does a server side include to the 
action bean using request.getDispatcher, and it works.

The value is obtained using the request attribute set by the container (using 
constant REQ_ATTR_INCLUDE_PATH) and is NOT decoded...

(debugged on tomcat 7)

If this behavior is the same on other appservers, then I think the proposed 
patch fixes the issue.

> Stripes decodes already-decoded URI
> -----------------------------------
>
>                 Key: STS-899
>                 URL: http://www.stripesframework.org/jira/browse/STS-899
>             Project: Stripes
>          Issue Type: Bug
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.5.7
>         Environment: Tomcat 7.0.37 on Mac OS X
> Tomcat 7.0.27 on Linux
>            Reporter: Peter Štibraný
>            Assignee: Remi VANKEISBELCK
>         Attachments: STS-899.patch
>
>
> GET /zip/DownloadZip.action/Len%25ovo.zip HTTP/1.1
> Host: localhost:8080
> ...
> fails with following exception: 
> java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in 
> escape (%) pattern - For input string: "ov"
>       at java.net.URLDecoder.decode(URLDecoder.java:173)
>       at net.sourceforge.stripes.util.StringUtil.urlDecode(StringUtil.java:90)
>       at 
> net.sourceforge.stripes.util.HttpUtil.getRequestedPath(HttpUtil.java:59)
>       at 
> net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:220)
>       at 
> net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:418)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> for action with @UrlBinding("/zip/DownloadZip.action/{archiveName}").
> Problem is that HttpUtil.getRequestedPath uses StringUtil.urlDecode to decode 
> servletPath + pathInfo, however both request.servletPath and request.pathInfo 
> are already decoded by Servlet Container, as mentioned in the documentation.
> In our case, servletPath returns "/zip/DownloadZip.action/Len%ovo.zip" while 
> pathInfo returns null. HttpUtil then tries to decode this string, which fails.
> However it should not even try to do the decoding on its own.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to