Re: first questions on validator.nu

On Aug 1, 2008, at 15:58, Yves Lafon wrote:
>
> On Fri, 1 Aug 2008, Henri Sivonen wrote:
>
>> Indeed, Jigsaw is missing the setCharacterEncoding() method on  
>> HttpServletRequest objects. I made the servlet catch  
>> java.lang.NoSuchMethodError there, so if the servlet is compiled  
>> under a more current servlet API, it runs without crashing (but  
>> without non-ASCII query string support) under a vintage servlet  
>> API. (Jigsaw also lacks getRequestURL(), but having that method  
>> wasn't critical, so I removed the call.)
>
> Ok, I will add those methods, just need to find at which level of  
> the servlet spec it belongs.

It seems that both methods are implemented, but the bundled  
servlet.jar doesn't match.

>> The other thing in the servlet that I needed to modify was treating  
>> a null return value from getPathInfo() as if the return value had  
>> been "/". (With longer paths, Jigsaw seems to swallow the trailing  
>> slash.)
>
> Hum, that look like a bug, I'll fix that.

Thanks.

>> There's an additional problem that is significant considering use  
>> as a Unicorn back end: When the method is POST, Jigsaw does not  
>> provide request URI query string parameters via the getParameter()  
>> method on HttpServletRequest. This means that the output format  
>> cannot be selected. (In Jetty, getParameter() returns request URI  
>> parameters when POSTing a non-form entity body.)
>
> IIRC, Jigsaw adds the two sets of parameters (from the decoded POST  
> if it applies + the URI ones), but it may be an issue if the content  
> is an uploaded file, for example.

If method is POST, Jigsaw goes into a branch that checks if the  
Content-Type is application/x-www-form-urlencoded and returns early if  
not. Instead of returning early, the GET case would have to run to  
achieve compatibility with Jetty.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Friday, 1 August 2008 13:34:42 UTC