portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Golden <ggol...@umich.edu>
Subject custommizer leaving (re: bug 6820), suspect redirect is not worki ng
Date Mon, 04 Mar 2002 15:43:00 GMT
Sorry, I hit the send button before I was done typing!  Here's the full
message:
 
* * *
 
As reported in bug 6820, the customizer is not leaving for me when I do a
"save and apply".  This is windows xp, jdk 1.4.0, tomcat 4.0.2, latest
jetspeed cvs.
 
I investigated this and found that the code responding to this is the
RowColumnControllerAction or MultiColumnControllerAction's doCancel().
 
In 1.3a2, these would cause an exit using this code:
 
    data.setScreenTemplate("Home");
 
Now, they cause an exit by doing a redirect:
 
                DynamicURI duri = new DynamicURI(data);
                data.getResponse().sendRedirect(duri.toString());

This sounds great!  But I suspect it's not working.
 
I've made an action class that test this. You can encode a link to this
class":
 
<a href=\"TestActionII
<http://localhost/jetspeed/portal/action/TestActionII\>
http://localhost/jetspeed/portal/action/TestActionII\">TestActionII</a>
 
in the navigation, or use a simple portlet to get the link on the page.
When I press the link, I get the same behavior as from the customizers, i.e.
the redirect is attempted and the browser never gets a page back.
 
Here's the action class:
 
* * *
 
package umich.chef.actions;
 
import org.apache.turbine.util.Log;
import org.apache.turbine.util.RunData;
import org.apache.turbine.modules.Action;
import org.apache.turbine.util.DynamicURI;
import org.apache.turbine.util.StringUtils;
 
public class TestActionII
    extends Action
{
    public void doPerform(RunData data)
    {
        try
        {
            DynamicURI duri = new DynamicURI(data);
            Log.debug(this + ".doPerform(): redirect to: " +
duri.toString());
            data.getResponse().sendRedirect(duri.toString());
        }
        catch ( Exception e )
        {
            Log.error(this + ".doPerform(): exception", e);
        }
    }
}

 
* * *
 
I get this in my log, showing that the code is run and the redirect is being
attempted with a reasonable url:
 
[Mon Mar 04 09:45:33 EST 2002] -- DEBUG --
umich.chef.actions.TestActionII@4c94e5.doPerform
<mailto:umich.chef.actions.TestActionII@4c94e5.doPerform> (): redirect to:
http://localhost/jetspeed/portal;jsessionid=EC51FA4C3333ADFE7AEC6457CEE38A6A
<http://localhost/jetspeed/portal;jsessionid=EC51FA4C3333ADFE7AEC6457CEE38A6
A> 

And no exception in the log.
 
So, I think the sendRedirect() is broken!
 
* * *
 
I then started a session in IE with cookies turned of, and got to the
display that has my link on it.  Then I used "protocol explorer", a java app
that you can use to send HTTP requests, and sent the request that would go
from clickin the link, with the proper session id, so it would look to the
server just like a click from IE.
 
The request:
 
GET
/jetspeed/portal/action/TestActionII;jsessionid=1D6A695ECA09E1A0E259C3276F30
FB32 HTTP/1.0 

The response:

HTTP/1.1 302 Moved Temporarily Connection: close Date: Mon, 04 Mar 2002
15:26:05 GMT Location:
http://localhost/jetspeed/portal;jsessionid=1D6A695ECA09E1A0E259C3276F30FB32
Server: Apache Tomcat/4.0.2 (HTTP/1.1 Connector) 

Which appears to be a real redirect.  But, in the jetspeed log:
 
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- Profiler fallback called with:
BaseProfile[:{},null,null,html,US,en,default.psml]
[Mon Mar 04 10:26:05 EST 2002] -- INFO -- PSML-Man: calculated
resource:user\aUser\html\en\US\default.psml. Base: C:\Program Files\Apache
Tomcat 4.0\webapps\jetspeed\WEB-INF\psml
[Mon Mar 04 10:26:05 EST 2002] -- INFO -- CastorPsmlManager: about to return
null doc: 
[Mon Mar 04 10:26:05 EST 2002] -- INFO -- PSML-Man: calculated
resource:user\aUser\html\en\default.psml. Base: C:\Program Files\Apache
Tomcat 4.0\webapps\jetspeed\WEB-INF\psml
[Mon Mar 04 10:26:05 EST 2002] -- INFO -- CastorPsmlManager: about to return
null doc: 
[Mon Mar 04 10:26:05 EST 2002] -- INFO -- PSML-Man: calculated
resource:user\aUser\html\default.psml. Base: C:\Program Files\Apache Tomcat
4.0\webapps\jetspeed\WEB-INF\psml
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG --
umich.chef.actions.TestActionII@d9ceea.doPerform
<mailto:umich.chef.actions.TestActionII@d9ceea.doPerform> (): redirect to:
http://localhost/jetspeed/portal;jsessionid=1D6A695ECA09E1A0E259C3276F30FB32
<http://localhost/jetspeed/portal;jsessionid=1D6A695ECA09E1A0E259C3276F30FB3
2> 
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- JetspeedTemplatePage: requested
template = Home.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- template exists: C:\Program
Files\Apache Tomcat
4.0\webapps\jetspeed\WEB-INF\templates\vm\screens\html\Home.vm returning
/html/Home.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- JetspeedTemplatePage: calculated
template = /html/Home.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- template exists: C:\Program
Files\Apache Tomcat
4.0\webapps\jetspeed\WEB-INF\templates\vm\layouts\html\default.vm returning
/html/default.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- JetspeedTemplatePage:
layoutTemplate is finally /html/default.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- template exists: C:\Program
Files\Apache Tomcat
4.0\webapps\jetspeed\WEB-INF\templates\vm\navigations\html\top.vm returning
/html/top.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- template exists: C:\Program
Files\Apache Tomcat
4.0\webapps\jetspeed\WEB-INF\templates\vm\controllers\html\column.vm
returning /html/column.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- template exists: C:\Program
Files\Apache Tomcat
4.0\webapps\jetspeed\WEB-INF\templates\vm\controls\html\jetspeed.vm
returning /html/jetspeed.vm
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG --
umich.chef.portlet.TestPortlet@537d55.getContent
<mailto:umich.chef.portlet.TestPortlet@537d55.getContent> (): handle:
-1391571260|two-2|one-1|_display-normal|three-3
[Mon Mar 04 10:26:05 EST 2002] -- DEBUG -- template exists: C:\Program
Files\Apache Tomcat
4.0\webapps\jetspeed\WEB-INF\templates\vm\navigations\html\bottom.vm
returning /html/bottom.vm

We see the redirect, and then MORE STUFF!  Like jetspeed is going on and
trying to make a page?  I wonder if there's some confusion in the response,
being both a header redirect and a body, that causes IE to get upset.
 
Can anyone help?  Or at least try it out and see if it works for you?
Thanks.
- Glenn

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message