You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Glenn Golden <gg...@umich.edu> on 2002/03/26 04:24:38 UTC

Turbine - Jetspeed interaction problems

Bug: IE hangs when leaving customizers... I don't know how widespread this
problem is, is it just IE 6 on XP? Is it just Jetspeed running with jdk
1.4.0 in Tomcat 4.0.2?  Whatever - it's a problem, and we are doing
something against the HTTP rules.

Problem: last month, many Jetspeed actions were modified to use a redirect
on cancel or done.  Code like this in MultiColumnControllerAction.java:

                // bring logged on user to homepage with internal redirect
                DynamicURI duri = new DynamicURI(data);
                data.getResponse().sendRedirect(duri.toString());

Note the comment refers to "internal redirect", but this is a real HTTP
redirect attempt.  After this is done in the action, the page goes on to
execute the screen.  It known nothing about the redirect.  It goes on to
write stuff to the response.

HTTP / servlet rules are that a) a redirect can be placed into the response
only before anything has been written to the response, and b) once the
redirect is placed, nothing may be written.  It seems that our violation of
this rule is messing up IE.

Comment:  I *really* like the idea of being able to use a redirect in an
action to end a customization to get the browser URL back to a good URL.

Solution:  Fix Turbine.  Turbine should not let us make this mistake.  The
Page code that is messing us up is in Turbine's DefaultPage.  And a final
mess up is made in the Turbine servlet's doGet().

1) Define a standard in Turbine for an action to make an HTTP redirect.
RunData already has get/setRedirectURI(), and just setting this to a
non-null non-blank value in an Action should be enough.

2) Modify DefaultPage doBuild() to, after running the action, check for a
redirect, and do whatever is needed.  If we standardize on
"RunData.setRedirectURI()", then the following code inserted in doBuild()
after the action call would work:

ActionLoader.getInstance().exec ( data, data.getAction() );
if ((data.getRedirectURI() != null) && (data.getRedirectURI().length() > 0))
{
    // directly set the response object for a redirect
    data.declareDirectResponse();
    data.getResponse().sendRedirect(data.getRedirectURI());
    return;
}

3) Turbine doGet() must make sure not to inadvertently create an output if
one has not yet been created!  This is what it does now in the finally()
block with "data.getOut().close();".  getOut() makes the PrintWriter, and
even closing it right away causes IE to get messed up.  We need this code
instead:

if (data.isOutSet()) data.getOut().close()

Next Step: If we like this, how do we get this into Turbine?

- 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/
--------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Turbine - Jetspeed interaction problems

Posted by David Sean Taylor <da...@bluesunrise.com>.
> Next Step: If we like this, how do we get this into Turbine?

Just join the Turbine-dev or Turbine-user list and post your argument
there.
Your argument is sound. Im on the turbine lists, I'll try to help if
they don't want to fix it.

You can also send them a patch.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Turbine - Jetspeed interaction problems

Posted by Chris Kimpton <ki...@yahoo.com>.
Hi,

--- Glenn Golden <gg...@umich.edu> wrote:
> Comment:  I *really* like the idea of being able to use a redirect
> in an
> action to end a customization to get the browser URL back to a good
> URL.
> 

My tuppence worth - I don't like this - it means going back to the
client browser, and telling it that it needs to get to another page
and it then comes in with another request for the other page.  I
guess it will probably come in the same "keep-alive" session - but it
is still network traffic.... sloooowwww...

Chris

=====
http://www.soccer2002.org.uk - join in and win CA$H!

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards�
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>