cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Collen <>
Subject Re: Spaces in request parameters: Problems with raw-request-param
Date Mon, 01 Dec 2003 18:25:23 GMT
(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:
> 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

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
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?


Tony, feeling tired after typing up this long message.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message