cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikolas List <>
Subject Re: Block redirect/dispatch
Date Wed, 09 Apr 2008 08:37:28 GMT

Patrick Heiden wrote:
> Hi Nikolas!
> Could you please state a snipped of your sitemap to get an overview of how you actually
redirect request params? 

My problem is, that I have no snippet. I'm looking for a miraculous(?) 
way of passing them.

Let me give an (old) example snippet: If both sitemap parts would reside 
in one block (for example mounted under mount-A and mount-B I would do 
sth like (ignoring the lookup in my bean knowing all URL-Mappings)

<map:match pattern="/contact/">
    <map:generate src="cocoon://mount-A/niceurl/serving/form"/>
    <map:serialize />
<map:match pattern="/contact/hints/">
    <map:generate src="cocoon://mount-B/otherurl/serving/hints"/>
    <map:serialize />

The source generated in this case is an internal cocoon redirect and has 
access to the ObjectModel so it knowns everything - thats the miracle 
here ;-).

Now both approaches I thought of first don't work:
<map:generate src="/block-A/niceurl/serving/form" />
is invalid as it tries to create a CocoonSource in the context of the 
core block "/", so the resource doesn't exist.

<map:generate src="servlet:block-A:/niceurl/serving/form" />
Creates (as far as I understood) a new request (without including the 
params from the Object model).

Three aproaches which work - but I don't like for various reasons:

<map:redirect-to uri="/block-A/niceurl/serving/form" />
Is an external redirect - realized by the user


The problem is I do not know the parameters needed by 

Implement an extension of DispatcherServlet, which first asks my bean 
for the URL mapping, then using the normal Block-Dispatching mechanism 
for the mapped path. ... This should not be the best approach, or?

I hope this clarifies my problem - or is it weird what I am trying to do?



>> I'm currently working on a cocoon 2.2 application using multiple blocks.
>> Every block is specialized on serving different content (probably
>> including forms). What I would like to achieve is to present a unified
>> URL space to the user, meaning something like
>> /block-A/niceurl/serving/form
>> /block-B/otherurl/serving/hints-from plain-file
>> should be
>> /contact/         (redirecting to /block-A/niceurl/serving/form)
>> /contact/hints/   (redirecting to /block-B/otherurl/serving/hints-fr...)
>> I first thought I could use a core block mounted at "/", resolving the
>> mapping (I have a spring bean administrating all mappings) and
>> "redirect" the request via Servlet-Service-Framework


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message