cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boisvert, Éric" <ebois...@nrcan.gc.ca>
Subject RE: spaces in request-param
Date Tue, 21 Sep 2004 13:50:01 GMT
Thank for the tip, but I did find this trick and it did not work either 

Failed to load sitemap from
file:/C:/jakarta-tomcat-4.1.29/webapps/cocoon/ngwd/search/sitemap.xmap

org.apache.cocoon.ProcessingException: Failed to load sitemap from
file:/C:/jakarta-tomcat-4.1.29/webapps/cocoon/ngwd/search/sitemap.xmap:
org.apache.avalon.framework.configuration.ConfigurationException: Error
while creating node 'generate' at
file:/C:/jakarta-tomcat-4.1.29/webapps/cocoon/ngwd/search/sitemap.xmap:23:22
4

cause: org.apache.avalon.framework.component.ComponentException:
input-modules: ComponentSelector could not find the component for hint
[url-encode] (key [url-encode])



>>
http://localhost:8080/cocoon/api/java/org/apache/cocoon/components/modules/i
nput/URLEncodeModule.html
interesting, I don't have this one, this explains the previous error.

I have 2.1.5 (running on JDK 1.4.x on Win2000 Server)

I assume I must recompile with some option turned on ?


-----Message d'origine-----
De : g[R]eK [mailto:gReK@warsztat.pac.pl]
Envoyé : 21 septembre, 2004 09:37
À : Boisvert, Éric
Objet : Re: spaces in request-param


<. 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/i
nput/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:gReK@warsztat.pac.pl                                    .>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message