Hmm. No response. Would really appreciate some help on this one.

It seems that calling  :

        PageLoader.getInstance().exec(data, defaultPage);

In Turbine.java always pushes data to the output stream, and therefore
the redirect code can never get called. If the method described below is
wrong, please let me know! If I perform an actual redirect in the action
or screen like this:

                         data.getResponse()
                             .sendRedirect ( data.getRedirectURI() );

I get a garbled page.

I am using the VelocityOnlyLayout. Could this make any difference?

Thanks in advance!

Gareth

> -----Original Message-----
> From: Gareth Coltman [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 07, 2001 15:11
> To: 'Turbine Users List'
> Subject: RE: Doing a redirect in an action vs. using Scarab's
> nextTemplate
>
>
> I have been trying to a do a redirect in my action like this:
>
>       TemplateLink tl = new TemplateLink( data );
>       tl.setPage(TurbineResources.getString("my_page"));
>       data.setRedirectURI( tl.getURI() );
>       data.setStatusCode( 302 );
>
> but this just returns me to me default page. I have debugged
> the following section of Turbine.java
>
>       if ( data.isPageSet() && data.isOutSet() == false )
>                 {
>
>                     // Modules can override these.
>                     data.getResponse()
>                         .setLocale( data.getLocale() );
>                     data.getResponse()
>                         .setContentType( data.getContentType() );
>
>                     // Handle the case where a module may want to send
>                     // a redirect.
>                     if ( ( data.getStatusCode() == 301 ||
>                            data.getStatusCode() ==  302 ) &&
>                          data.getRedirectURI() != null )
>                     {
>                         data.getResponse()
>                             .sendRedirect ( data.getRedirectURI() );
>                     }
>
>                     // Set the status code.
>                     data.getResponse().setStatus (
> data.getStatusCode() );
>                     // Output the Page.
>                     data.getPage().output (data.getOut());
>                 }
>
> And found that this is never entered in my code, because
> data.isPageSet() always returns FALSE and data.isOutSet() is
> always TRUE.
>
> Any ideas guys?
>
> Gareth
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



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

Reply via email to