cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <coc...@lojjic.net>
Subject Re: How can I redirect a Cocoon uri to my regular cgi-bin ? NB with request parameters, please.
Date Sun, 19 Mar 2006 22:31:25 GMT
Ken Starks wrote:
> I have a simple (Sorry, its Hello, World) script, writen in python.
> It works fine for example using:
>  http://localhost/cgi-bin/hello.py?name="fred"&n=4
> 
> Now I have wish to have it as part of a Cocoon project called 'Graphics' and 
> I eventually got it to partly work with the following entry in
>   $Catalina_Home/webapp/Graphics/sitemap.xmap
> 
>         <map:match pattern="Hello">
>           <map:read src="http://localhost/cgi-bin/Barehello.py"  />
>         </map:match> 
> 
> Script 'Barehello.py is the same as hello.py except it misses out the
> <?xml ... ?> line
> 
> The result, in my browser, of typing 
> 
>     http://localhost:8888/Graphics/Hello?name=Fred&n=12
> 
>    is a web page, but it completely ignores the request parameters 'name' and 
> 'n'. It uses the defaults, which are name=World&n=10
> 
> What should I do? 

You need to pass the request query string (the part after the ? in the
URL) to your python page. You can use the request input module for this:

<map:match pattern="Hello">
  <map:read
src="http://localhost/cgi-bin/Barehello.py?{request:queryString}"  />
</map:match>

Hope that helps
--Jason

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


Mime
View raw message