<map:read src="http://url-of-your-servlet"/>

That should do it. It should make Cocoon into a simple reverse-proxy.

Regards, Upayavira

Victor Batista wrote:
Hi! Thanks for your reply. Unfortunately I need to Forward the request, not
to redirect it.
Can I somehow use the Container Dispatcher to handle this?

   I tried the code below inside my Cocoon Action, but I got a Cocoon Error:

try {
    ServletContext context = (ServletContext)getContext();
    context.getRequestDispatcher("/xpto").forward((ServletRequest)request,
(ServletResponse)response);
    return null;
} catch (IOException e1) {
    log.error("Error redirecting to HOME.ACTION!!");
}

   Any help would really be appreciated.
Thanks in advance, Victor Batista


-----Original Message-----
From: Geert Josten [mailto:[EMAIL PROTECTED] Sent: quarta-feira, 28 de Setembro de 2005 7:58
To: [email protected]
Subject: Re: Forward to another Servlet from Cocoon

Hi Victor,

I guess that you mean that you have defined multiple servlets in your
WEB-INF/web.xml file?

If a url is catched by the CocoonServlet and you want to fetch data from
another servlet or redirect to it, even within the same war, you will have to go through the http stack again. In other words, you could use <map:redirect-to> as suggested by Upayavira, but you will have to start the uri attribute with "http://";

HTH,
Geert


Hello!

I have a web application with a few servlets, one of which extends the CocoonServlet. In some cases, I need to forward from the CocoonServlet to a different servlet of my web application. How can I do this?


Use:

<map:redirect-to uri="......"/>

To forward to a URI that is handled by your servlet instead.

Regards, Upayavira

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to