Michael Edge wrote:
> Hi All
> 
> It seems to me that the following code will not work in Cocoon 2. 
 > I believe it works in Cocoon 1, but for some reason the request
 > and response objects available within XSP for Cocoon 2 are not
 > HttpServletRequest and HttpServletResponse objects, but rather
 > some cocoon equivalents, org.apache.cocoon.environment.Response
 > and org.apache.cocoon.environment.Request. Unfortunately these
 > new classes do not include the sendRedirect method. Any ideas
 > how I would do this? I need to construct a URL in my code
 > and redirect to that URL.
> 
>   <xsp:logic>
>     String url = URLEncoder.encode(url + whatever + parameters);
>     response.sendRedirect(url);
>   </xsp:logic>
> 
> Thanks

Don't use XSPs for flow control, use the sitemap.

Add an Action that does this and redirect. You can write Actions using 
XSPs BTW.

Better still, use the action to return the url and then do a <redirect> 
in the sitemap; it makes your action more reusable.

-- 
Nicola Ken Barozzi                   [EMAIL PROTECTED]
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to