cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Benndorf <kai.bennd...@pb.izm.fhg.de>
Subject Re: Spaces in request parameters: Problems with raw-request-param
Date Tue, 02 Dec 2003 07:34:48 GMT
Hi Tony,

if there really is no way to get the encoded request parameter, although 
it's not very smart, we still have the possibility to encode the 
parameter anew. Is there already an existing  function to encode the 
parameter somewhere?

Regards

Kai

Tony Collen schrieb:

> (I am bringing this thread over to -dev to ask the experts for help)
>
> Kai Benndorf wrote:
>
>> Hi Tony,
>>
>> i've opened  the following bug:
>>
>> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25102
>>
>> Best Regards
>>
>> Kai
>
>
> Alright, due to my limited knowledge of Avalon, and my brain being in 
> a general state of rustiness, I'm having some problems.
>
> Here's what I know so far:
>
> - The RawRequestParameterModule is not actually giving raw request 
> parameters (i.e. URL-Encoded)
>
> Reading from the Javadocs:
>  * RawRequestParameterModule accesses request parameters without
>  * decoding or casting. It uses the get() method instead of the 
> getParameter()
>  * method of the {@link org.apache.cocoon.environment.Request Request} 
> This is useful
>  *  for example in conjunction with uploads.
>
> - The RRPM uses this to get the request parameter:
>
>     ObjectModelHelper.getRequest(objectModel).get( pname );
>
> Alright, so I track down Cocoon's HttpRequest (and also the Request 
> interface).  Looking at both, I see no mention of a contract where 
> Request.get(parameter) must return the parameter's value encoded.
>
> Looking further into o.a.c.e.h.HttpRequest, I notice:
> - If the request is not a MultipartHttpServletRequest, the following 
> is used:
>     String[] values = req.getParameterValues(name);
>
> Alright, here, req is a plain old 
> javax.servlet.http.HttpServletRequest.  The Javadocs for 
> getParameterValues says the following:
>
> "Returns an array of String objects containing all of the values the 
> given request parameter has, or null if the parameter does not exist."
>
> It says nothing about being encoded.
>
> AFAIK, the only way to get encoded (or "raw") request parameter values 
> is to look at the raw query string and break it up on & characters, or 
> break it up on the request parameter separator .. I know that PHP 
> allows you to set the parameter separator character to something else 
> (most commonly ';').  But now I'm getting off on a tangent.
>
> Anybody have suggestions?
>
> Regards,
>
> Tony, feeling tired after typing up this long message.
>     
>
>
>
>



Mime
View raw message