cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <coc...@leverageweb.com>
Subject Re: Spaces in request parameters: Problems with raw-request-param
Date Tue, 02 Dec 2003 11:31:51 GMT
Christian Haul wrote:

> Tony Collen wrote:
> 
>> Kai Benndorf wrote:
>>
>>> 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
>>
>>
>>
>> Well, if we can't solve the problem correctly, the quick and dirty 
>> solution is to manually re-encode the value inside the inputmodule 
>> using java.net.URLEncoder.encode().
>>
>> Still working on it.. must have patience! :)
> 
> 
> If you do this, please bear in mind that I made this module for a 
> purpose: to get at the uploaded data.
> The Request.getParameter() method unfortunately converts them to 
> java.lang.String which effectively
> prevents this. So, if you change this module, please check that the 
> object is a String before re-encoding
> it. And check that the upload sample in the databases block works with 
> the modification.

If it turns out that the un-decoded (raw) parameter really should never 
be returned from the Request, then it makes more sense to introduce a 
"url-encode" input module which would encode a given string, including 
the output of another module for use as a valid url in the sitemap. 
IIRC there have been users with valid use cases for this with no way to 
automatically come up with the value.

Just my .02,

Geoff


Mime
View raw message