<. Hi �ric! .>

Tuesday, September 21, 2004, 2:11:37 PM, you wrote:

B�> Greetings

B�> I'm trying to solve a problem that I think is a very basic functionality.  I
B�> simply cannot believe there are no way to do this, but after 2 days googling
B�> aroung,. I still don't find a solution to this.

B�> I'm trying to pass request-parameter that contains spaces to a generator ,
B�> using this pipeline:

B�> <map:pipeline>
B�>  <map:match pattern="gazetteer">
B�>     <map:generate type="file"
B�> src="http://cgdi-dev.geoconnections.org/cgi-bin/prototypes/cgdigaz/cgdigaz.c
B�> gi?version=1.0&amp;request=GetPlacenameGeometry&amp;geomtype=bbox&amp;PLACEN
B�> AME={raw-request-param:PLACE}"/>

I'm not sure why raw-request-param is used. To avoid decoding and casting? I
think it's not good practice. Try to use url-encode[1] and request-param
modules:
{url-encode:{request-param:PLACE}}

It works for me very well.

<snip/>

B�> and somewhere down this impressive list I see

B�> Caused by: java.io.IOException: Server returned HTTP response code: 400 for
B�> URL:
B�> http://cgdi-dev.geoconnections.org/cgi-bin/prototypes/cgdigaz/cgdigaz.cgi?ve
B�> rsion=1.0&request=GetPlacenameGeometry&geomtype=bbox&PLACENAME=Black River
B�>     at

RFC[2] says:
400 Bad Request

The request could not be understood by the server due to malformed syntax.

I think it's error due to not escapted spaces or other characters.

B�> Of course, if I copy this URL
B�> (http://cgdi-dev.geoconnections.org/cgi-bin/prototypes/cgdigaz/cgdigaz.cgi?v
B�> ersion=1.0&request=GetPlacenameGeometry&geomtype=bbox&PLACENAME=Black
B�> River)and copy it in a browser, it works fine

AFAIK Browsers escape charactacters automatically.

B�> Any clue ?  Sorry if I missed something obvious but I search and did not
B�> find anything.  I can't believe I'm the only one passing parameters with
B�> spaces in the whole cocoon community ! 

Hope this help.

[1] 
http://localhost:8080/cocoon/api/java/org/apache/cocoon/components/modules/input/URLEncodeModule.html
    (I give you local link because javadocs on cocoon's site seem to be outdate)
[2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

-- 
Best regards
<. g[R]eK mailto:[EMAIL PROTECTED]                                    .>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to