Here is the diff of the changes I made to get around the infinite redirect.


Index: Turbine.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/Turbine.java,v
retrieving revision 1.28
diff -r1.28 Turbine.java
177a178,182
>      * Track new sessionIds to prevent infinite redirect 
>      */
>     private TreeSet newSessions = new TreeSet();
> 
>     /**
320c325
<                 if (data.getParameters().getString("redirected") == null)
---
>                 if (!newSessions.contains(data.getSession().getId()))
321a327
>                     newSessions.add(data.getSession().getId());
323,324c329,330
<                 }
<                 // if the redirected param was already there then we've
been
---
>                 }     
>                 // if the sessionId is already in newSessions then we've
been
337a344
>             newSessions.remove(data.getSession().getId());






-----Original Message-----
From: Josh Shenberg 
Sent: Thursday, December 21, 2000 4:55 AM
To: 'Turbine'
Subject: RE: Infinite redirect detected


I got the same error several times.  The problem looks like the users first 
request of their session has the redirect/true part of the url that Turbine
appends
to a url before redirecting it so that it can detect an infinite redirect.
This might be a problem with the url the user is bookmarking such as if they

bookmark the first page that is displayed in a session since this will 
have the redirect/true as part of the url or it could be that IE is pulling
something out of it's cache.

Here's a possible solution

Instead of adding redirected/true to the address that is sent in the
redirect, 
add the data.getSession().getId() String to a Collection which could be a 
static of Turbine.java or stored in the cache service.

Then instead of checking for the redirected/true portion of the address, you
can check
to see if data.getSession().getId() is in the collection of session id's.

Josh Shenberg

-----Original Message-----
From: Magnus ?or Torfason [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 20, 2000 1:13 PM
To: Turbine
Subject: Infinite redirect detected


Here is my problem.  I realize that this most likely
stems from some IE stupidity, but is very annoying nevertheless.

My webapp is contained in a frame, and I have resolved the
events that lead to this error

The frame is bookmarked.
The browser is closed and reopened.
The bookmark is selected.

On this first hit, the server detects an infinite redirect,
and throws a stacktrace in the face of the user.

This does NOT happen if the servlet is bookmarked directly, which
is why I strongly suspect a browser bug.

This is annoying because I can't really say to my users
that my webapp must not be contained in a frame, that it cannot
be bookmarked, or that it is not viewable with IE 5.

Any thoughts?




There has been an error! Please review the exception below for more
information.
Get/Post Data:
template = ErrorScreen
redirected = true

The exception is:
java.lang.Exception: Infinite redirect detected...
  at org.apache.turbine.Turbine.doGet(Turbine.java:268)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
  at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
  at
org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
  at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
  at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:160)
  at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
)
  at java.lang.Thread.run(Thread.java:479)>



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to