Greetings
I'm trying to solve a problem that I think is a very basic functionality. I
simply cannot believe there are no way to do this, but after 2 days googling
aroung,. I still don't find a solution to this.
I'm trying to pass request-parameter that contains spaces to a generator ,
using this pipeline:
<map:pipeline>
<map:match pattern="gazetteer">
<map:generate type="file"
src="http://cgdi-dev.geoconnections.org/cgi-bin/prototypes/cgdigaz/cgdigaz.c
gi?version=1.0&request=GetPlacenameGeometry&geomtype=bbox&PLACEN
AME={raw-request-param:PLACE}"/>
<map:transform type="xslt" src="style/gaz_result.xslt"/>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
This works fine with a single word (such as 'Toronto') but fails with a name
containing a space (eg. 'Black River' or Black%20River or Black+River)
I get a org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
java.io.IOException
The exception stacks starts with
Original Exception: java.io.IOException
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
.java:591)
at
org.apache.excalibur.source.impl.URLSource.getInputStream(URLSource.java:252
)
at
org.apache.cocoon.components.source.SourceUtil.getInputSource(SourceUtil.jav
a:418)
at
org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:252)
at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:116)
[...]
and somewhere down this impressive list I see
Caused by: java.io.IOException: Server returned HTTP response code: 400 for
URL:
http://cgdi-dev.geoconnections.org/cgi-bin/prototypes/cgdigaz/cgdigaz.cgi?ve
rsion=1.0&request=GetPlacenameGeometry&geomtype=bbox&PLACENAME=Black River
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
.java:789)
at
sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection
.java:1446)
at
java.net.HttpURLConnection.getHeaderFieldDate(HttpURLConnection.java:343)
at java.net.URLConnection.getLastModified(URLConnection.java:429)
at
org.apache.excalibur.source.impl.URLSource.getInfos(URLSource.java:160)
at
org.apache.excalibur.source.impl.AbstractSource.checkInfos(AbstractSource.ja
va:58)
at
org.apache.excalibur.source.impl.AbstractSource.getLastModified(AbstractSour
ce.java:138)
at
org.apache.excalibur.source.impl.URLSource.getValidity(URLSource.java:265)
at
org.apache.cocoon.generation.FileGenerator.getValidity(FileGenerator.java:10
2)
at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline
.getValidityForInternalPipeline(AbstractCachingProcessingPipeline.java:897)
at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline
.setupValidities(AbstractCachingProcessingPipeline.java:399)
at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline
.setupPipeline(AbstractCachingProcessingPipeline.java:655)
at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipe
line(AbstractProcessingPipeline.java:506)
at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(Abs
tractProcessingPipeline.java:464)
... 59 more
Of course, if I copy this URL
(http://cgdi-dev.geoconnections.org/cgi-bin/prototypes/cgdigaz/cgdigaz.cgi?v
ersion=1.0&request=GetPlacenameGeometry&geomtype=bbox&PLACENAME=Black
River)and copy it in a browser, it works fine
I get the same exception wheter I use %20 or +, etc..
Any clue ? Sorry if I missed something obvious but I search and did not
find anything. I can't believe I'm the only one passing parameters with
spaces in the whole cocoon community !
Cheers and thanks
================================================================
Eric Boisvert
Sp�cialiste TI-GI / IT-IM specialist
[EMAIL PROTECTED], 418-654-3705, facsimile/t�l�copieur
418-654-2615
880 Chemin Ste-Foy, Bureau 840, Qu�bec (Qu�bec), G1S 2L2
880 Ste-Foy street, Room 840, Quebec, Quebec, G1S 2L2
Laboratoire de cartographie num�rique et de photogramm�trie (LCNP)
Digital Cartography and Photogrammetry Laboratory (DCPL)
Commission g�ologique du Canada (Qu�bec) / Geological Survey of Canada
(Quebec)
Ressources naturelles Canada / Natural Resources Canada
Gouvernement du Canada / Government of Canada
http://www.cgcq.rncan.gc.ca/lcnp
http://www.nrcan.gc.ca/gsc
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]