Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 63974 invoked from network); 1 Dec 2003 18:20:54 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Dec 2003 18:20:54 -0000 Received: (qmail 63145 invoked by uid 500); 1 Dec 2003 18:20:31 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 63112 invoked by uid 500); 1 Dec 2003 18:20:31 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 63091 invoked from network); 1 Dec 2003 18:20:30 -0000 Received: from unknown (HELO mhub-m6.tc.umn.edu) (160.94.23.36) by daedalus.apache.org with SMTP; 1 Dec 2003 18:20:30 -0000 Received: from umn.edu (rose.ce.umn.edu [134.84.148.222] (may be forged)) by mhub-m6.tc.umn.edu with ESMTP; Mon, 1 Dec 2003 12:20:34 -0600 (CST) X-Umn-Remote-Mta: [N] rose.ce.umn.edu #+HF+LO Message-ID: <3FCB8793.2000005@umn.edu> Date: Mon, 01 Dec 2003 12:25:23 -0600 From: Tony Collen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en,pdf MIME-Version: 1.0 To: dev@cocoon.apache.org CC: users@cocoon.apache.org, kai.benndorf@pb.izm.fhg.de Subject: Re: Spaces in request parameters: Problems with raw-request-param References: <3FC75881.5030909@pb.izm.fhg.de> <3FC7B121.5080400@umn.edu> <3FCB0F64.7010507@pb.izm.fhg.de> In-Reply-To: <3FCB0F64.7010507@pb.izm.fhg.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N (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.