cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Pruy <Rainer.P...@Acrys.COM>
Subject Re: Accesing url params in flow using servlet: protocol Cocoon 2.2
Date Mon, 17 Mar 2008 15:06:11 GMT
Hello,

please keep in mind, that using map:part will cause a new (sub) request.
This (sub) request does not inherit any parameters from current request.
If you want access to your current (external) request parameter "q", you must pass it with
your src="" URL
e.g in your case <map:part src="servlet:/get_ids_for_solr/{1}/{2}?q={raw-request-param:q}"/>

However, you might have a look at thread "C2.2: undecoded URI params", as I'm experiencing
problems passing URI reserved or disallowed
characters (e.g. <space>) this way.

regards
Rainer

dkropotova schrieb:
> Dear all,
> 
> I'm a bit confused what's the difference between servlet and cocoon
> protocols in Cocoon 2.2.
> 
> I have a pipeline that takes a request - the first step in that pipeline is
> an  aggregated generator, where one of the map:part calls internal pipeline
> (<map:part src="servlet:/get_ids_for_solr/{1}/{2}"/>)
> 
> From that internal pipeline I call a function at the flow script where I
> need to access certain url paramaters from the original request. With the
> servlet protocol (of that map:part from the main pipeline) I don't seem to
> be able to access url parameters from within flowscript - I have a parameter
> called q & in flowscript if I do cocoon.request.q I get the value undefined.
> 
> Should I be able to access url parameters in flow using the servlet
> protocol?
> 
> I also tried to implement the solution using cocoon: protocol - using this
> approach I can access parameters in the flow, using cocoon.request.q.
> 
> When I extract the url parameter in flow, I then use sendPage to call
> another entry in the sitemap (shown below). 
> 
> 
> <map:pipeline>
>  <map:match pattern="get_chapter_content_solr/*">
>   <map:generate type="request">
>    <map:parameter name="id" value="{1}"/>
>   </map:generate>
> 
>   <!-- Constructs the <cinclude:include> element. -->
>   <map:transform src="xsl/solr-chapter-view.xsl">
>    <map:parameter name="host" value="${solr.baseurl}/select"/>
>   </map:transform>
>   <map:transform type="cinclude"/>
>   <map:transform type="saxon" src="xsl/solr-chapter-content.xsl"/>
>   <map:serialize type="xml"/>
>  </map:match>
> </map:pipeline>
> 
> 
> When calling this pipeline using the cocoon: protocol the
> solr-chapter-view.xsl transformation step in the pipeline doesn't seem to
> get run.  But when I use the servlet protocol I get the output I expect (but
> am unable to pick up the url parameter mentioned above in the flow).
> 
> 
> So, essentially using the servlet protocol this pipeline works fine, but I
> can't access the url param I need. Using the cocoon protocol the request
> param can be extracted in flow, but the pipeline above doesn't seem to work.
> 
> Did anyone has the same problem of accessing url parameters in flow while
> using servlet protocol? Does anyone have any suggestions?
> 
> I would be extremely grateful for any tip.
> Many thanks,
> 
> Daria

-- 
Rainer Pruy
Geschäftsführer

Acrys Consult GmbH & Co. KG
Untermainkai 29-30, D-60329 Frankfurt
Tel: +49-69-244506-0 - Fax: +49-69-244506-50
Web: http://www.acrys.com -  Email: office@acrys.com
Handelsregister: Frankfurt am Main, HRA 31151

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


Mime
View raw message