Hi Paul
I finally got both the LoggingFile to work and also Live HTTP headers
working on Firefox. Here's the result:
URL:
http://localhost:28080/jjersey/testIt/test/first/second%2ethird
Jersey Log:
* In-bound request received
11 > GET
http://localhost:28080/jjersey/testIt/test/first/second%2ethird
11 > accept-encoding: gzip,deflate
11 > connection: keep-alive
11 > accept-language: en-us,en;q=0.5
11 > host: localhost:28080
11 > accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
11 > user-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)
11 > accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
11 > keep-alive: 300
11 >
11 < 200
11 < Content-Type: text/html
11 <
**first**second.third
11 * Out-bound response sent
FireFox:
HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html
Content-Length: 21
Date: Tue, 18 Aug 2009 17:56:15 GMT
-------------------------------------------------------------------------------
URL:
http://localhost:28080/jjersey/testIt/test/first/second%2fthird
Jersey Log: NONE
Firefox:
HTTP/1.x 400 Bad Request
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Tue, 18 Aug 2009 17:53:57 GMT
Connection: close
-------------------------------------------------------------------------------
I'm not sure where the 400 is being create - tomcat?
I hope you have an idea on this.
My earlier note containing the test code is below.
Thanks
David
Hi Paul
Unfortunately your server is down right now so I haven't been able to
follow up on the logging filter. I include the code and results using a
Firefox browser to a tomcat server on Windows XP. This is using jersey 1.1.0
Admittedly, the browser may be doing something in between. BUT, Note that
URL:
http://localhost:28080/jjersey/testIt/test/first/second/third
Results in the error: The requested resource () is not available.
while
URL:
http://localhost:28080/jjersey/testIt/test/first/second%2fthird
Results in a blank screen
For non-%2f escape sequences Jersey is able to insert the character
From this it appears that jersey is not handling %2f like a / but,
also, it is not treating it as an embedded escaped character.
Sorry to push to get this resolved but if Jersey cannot escape a / we
will not be able to use it without providing our own escape mechanism.
I will continue to try and get what I need for the log filtering.
Thanks so much
David
Code:
package org.cdlib.test;
import javax.ws.rs.GET;
import javax.ws.rs.PathParam;
import javax.ws.rs.Path;
@Path ("/testIt")
public class TestIt {
@GET
@Path("test/{item1}/{item2}")
public String getFileState(
@PathParam("item1") String item1,
@PathParam("item2") String item2)
{
return "**" + item1 + "**" + item2;
}
}
Results:
http://localhost:28080/jjersey/testIt/test/first/second
**first**second
http://localhost:28080/jjersey/testIt/test/first/second/third
Browser reports back error: The requested resource () is not available.
http://localhost:28080/jjersey/testIt/test/first/second%2ethird
**first**second.third
http://localhost:28080/jjersey/testIt/test/first/second%2fthird
blank screen
http://localhost:28080/jjersey/testIt/test/first/second0third
**first**second0third
http://localhost:28080/jjersey/testIt/test/first/second%a9third
**first**second?third
Paul Sandoz wrote:
>
> On Aug 18, 2009, at 1:30 AM, dloy wrote:
>
>> I have a PathParam that contains a forward slash(data/fptr11.xls). Is
>> there a mechanism for escaping the slash within Jersey? I tried URL
>> Encoding (data%2Ffptr11.xls) in firefox- this got no response - it
>> appears to repost whatever screen is there. URL Encoding with other
>> values than %2F appears to work.
>>
>> To verify this I put in code to convert a $ to /. So data$fptr11.xls
>> AND data%24fptr11.xls both work properly so the URL Encoding does
>> seem to work for other characters.
>>
>
> What Web container are you using?
>
> I suspect that the Web container is not correctly managed %2F and the
> value is getting decoded before it reaches Jersey and then matching
> will fail and return a 404 response.
>
> You can verify if this is the case by adding request/response logging
> to the server side:
>
> https://jersey.dev.java.net/nonav/apidocs/1.1.1-ea/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html
>
>
> Paul.
>
>> Any ideas?
>> Thanks
>> David
>>
>> Example URL:
>> http://localhost:28080/jstore/fileState/15/12345-abcde/2/data%2ffptr11.xls
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>