Thanks Nikolaos. Response in-line...

On 11/ 5/10 04:14 PM, Nikolaos Giannopoulos wrote:
> Martin,
>
> Comments in-line...
>
>
> Martin Walsh wrote:
>> Nope, same issues described below.
>>
>> M
>>
>> On 11/ 5/10 01:39 PM, Ben Gunter wrote:
>>
>>> Please try 1.5.3 and see if that helps.
>>>
>>> -Ben
>>>
>>> On Fri, Nov 5, 2010 at 9:27 AM, Martin Walsh<martin.wa...@oracle.com
>>> <mailto:martin.wa...@oracle.com>>  wrote:
>>>
>>>      I am running into a few issues with clean URLs. I am using Stripes 
>>> 1.5.2
>>>      and Tomcat 6.0.26.
>>>
>>>      I am attempting to use clean URLs with parameters that represent a file
>>>      path.
>>>
>>>      e.g.
>>>
>>>      binding = "/action/test/{path}"
>>>      parameter = "String path = tmp/test.txt"
>>>
>>>      I am using the stripes:link tag to generate the link on a JSP page 
>>> using
>>>      the path variable.  I am currently running into two issues.
>>>
>>>      Firstly, the link generated is escaped, escaping the '/'. This results
>>>      in a link of http://localhost:8080/test/action/test/tmp%2Ftest.txt. 
>>> When
>>>      clicked on, Tomcat returns a error 400 (Bad Request).  The request does
>>>      not even make it through to Stripes.
>>>
> That appears to be encoded properly. Is the URL correct i.e. have you
> tried simply going to:
>
> http://localhost:8080/test/action/test/tmp_test_txt

The URL would be correct if the %2F was a '/'.  i.e. The following works:

http://localhost:8080/test/action/test/tmp/test.txt

But with the final '/' being encoded because it is technically a 
parameter, it results in a request of

http://localhost:8080/test/action/test/tmp%2Ftest.txt

This request then does not even make it to Stripes.  Tomcat just returns 
a 400 error, before it even invokes Stripes.  So I think the question 
really is, which side is wrong.  Tomcat not even trying to handle the 
URL, or Stripes encoding the '/' when generating the clean URL.

>
> Otherwise it seems quite bizarre. The other thing I would suggest is
> perhaps setting up a root binding like "/action" and then in debug mode
> see what the request looks like that may be tripping up Stripes and not
> matching.

Unfortunately, the request does not even make it to Stripes, so this 
would not work.

>
>
>>>      Secondly, if the parameter includes a special char, i.e. a space.
>>>
>>>      e.g.
>>>
>>>      parameter = "String path = test file.txt"
>>>
>>>      the link is encoded, which gives
>>>      http://localhost:8080/test/action/test/test+file.txt. However the
>>>      parameter is not decoded, so in my action bean, the path variable is
>>>      "test+file.txt" instead of "test file.txt".
>>>
> That isn't totally surprising to me. Just use:
>
> java.net.URLDecoder.decode(string, encoding);
>
> In say the setPath(...) method as you expect that you might have a case
> wherein the parameter has encoded characters.

I can do that as a fix for now.  Should this not be fixed in Stripes though?

M

>
> HTH,
>
> --Nikolaos
>
>>>
>>>      Thanks in advance for any help.
>>>
>>>      M
>>>
>>>
>>>
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to