portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Golden <ggol...@umich.edu>
Subject RE: Jetspeed / Turbine problems with redirects
Date Thu, 28 Mar 2002 20:53:31 GMT
John -

This was an oversite on my part.  I agree that the code you identified in no
longer needed.

I also think that setting the status code is not needed, either on the part
of the turbine users or in our turbine code to do the redirect.  For the
user - programmers, we would just do the data.setRedirectURI().  And for the
response object, sendRedirect() takes care of all the status codes.

Thanks for finding this, and for taking care of this.

- Glenn
 
--------------------------------------------
Glenn R. Golden, Systems Research Programmer
University of Michigan School of Information
ggolden@umich.edu               734-615-1419
http://www-personal.si.umich.edu/~ggolden/
--------------------------------------------




> -----Original Message-----
> From: John McNally [mailto:jmcnally@collab.net] 
> Sent: Thursday, March 28, 2002 3:08 AM
> To: Turbine Developers List
> Subject: Re: Jetspeed / Turbine problems with redirects
> 
> 
> Why is this code left in the if(!requestRedirected) block?
> 
>   // 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() );
>   }
> 
> And is there any reason to set a status code before the 
> redirect?  I ask because the code above checks for it, but 
> does not set it until afterward  (most likely meant for non 
> 301 or 302 responses.)  And in your patch it is not set at 
> all.  I'm just looking for clarification.
> 
> john mcnally
> 
> 
> Glenn Golden wrote:
> > 
> > I've attached a patch file to make a change to turbine for jetspeed.
> > 
> > The change relates to how an Action class can request a URL 
> redirect 
> > for the response, rather than processing the response to completion 
> > with a body and such.
> > 
> > To follow the Servlet HTTP rules, we must do the redirect before 
> > committing any headers or body to the response, and once we do a 
> > redirect we must not do anything else with the response.
> > 
> > Rundata already has a mechanism for specifying a redirect: 
> > setRedirectURI().  I propose that this is the standard way for an 
> > Action class to ask for a redirect. Just call this on your rundata 
> > with the URI for the redirect.
> > 
> > To smooth the path back from the Action exec, DefaultPage 
> is modified 
> > by the patch to recognize that a redirect was set in the 
> data, and to 
> > do an early return before doing anything else to the data's 
> response, 
> > such as executing the screen and layout and such.
> > 
> > Finally, Turbine is modified by the patch to recognize the 
> request for 
> > a redirect, implement the request, and make sure not to accidently 
> > open the output stream on the response in the attempt to 
> make sure it 
> > is closed.
> > 
> > I have applied this patch to both the tip of the cvs, and to the 
> > version of turbine that Jetspeed is currently using (-r 
> > TURBINE_2_2_B1).  It works in both.
> > 
> > Thank you for your help in resolving this problem.
> > 
> > - Glenn
> > 
> > --------------------------------------------
> > Glenn R. Golden, Systems Research Programmer
> > University of Michigan School of Information
> > ggolden@umich.edu               734-615-1419
> > http://www-personal.si.umich.edu/~ggolden/
> > --------------------------------------------
> > 
> > > -----Original Message-----
> > > From: John McNally [mailto:jmcnally@collab.net]
> > > Sent: Tuesday, March 26, 2002 10:36 AM
> > > To: Turbine Developers List
> > > Subject: Re: Jetspeed / Turbine problems with redirects
> > >
> > >
> > > Please send your changes as a "cvs diff -u".
> > >
> > > john mcnally
> > >
> > 
> >   
> --------------------------------------------------------------
> ----------
> >                                             Name: 
> 2002_03_26_turbine_redirect_patch.txt
> >    2002_03_26_turbine_redirect_patch.txt    Type: Plain 
> Text (text/plain)
> >                                         Encoding: quoted-printable
> > 
> >   
> > 
> --------------------------------------------------------------
> ----------
> > --
> > To unsubscribe, e-mail:   
> <mailto:turbine-dev-> unsubscribe@jakarta.apache.org>
> > For 
> additional commands, 
> e-mail: <mailto:turbine-dev-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:turbine-dev-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message