You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Young <ja...@onyourside.net> on 2003/05/02 06:44:21 UTC

Infinite loop when using Struts 1.1RC1 with Tomcat 4.1.24

Struts and Tomcat gurus,

I encounter an infinite loop when using Struts 1.1RC1 with Tomcat 4.1.24.  I am not sure if this is a Tomcat problem or a Struts problem.  I understand the scenario I encounter is probably rare, and I can definitely work around the problem, but I thought it's a good idea to report it here.  I also have written a simple web app based on the Struts blank web app that comes with Struts 1.1RC1 to reproduce this problem reliably.  I can send this war file to anyone who is interested in.

Here is the setup:

Struts actions: FirstAction, IncludedAction, ForwardedAction.

In FirstAction, use a response wrapper to wrap the response object, and use RequestDispatcher to include the output of IncludedAction.  In IncludedAction, use Struts action mapping and forward to ForwardedAction.  ForwardedAction simply writes something to the response output stream.

If I configure Struts to use path (such as "/struts") rather than pattern matching (such as "/*.do") in struts-config.xml, the above setup will cause Struts and Tomcat to go into an infinite loop.

What happens is: RequestProcessor.processPath() first gets the path from the request object's include path attribute.  So when Struts is processing my ForwardedAction, it never loads my ForwardedAction, instead, it loads my IncludedAction because of the presence of the include path attribute in the request object.  Since IncludedAction forwards to ForwardedAction, it's obvious that we have an infinite loop here.

This may be a Tomcat issue because maybe the include path attribute should have been cleared somehow.

Thanks!  /M.

session management under struts

Posted by Dimitar Georgievski <di...@websyn.com>.
I'm losing a bean stored in the session objects after couple of requests.

The application generates the following message:
org.apache.jasper.JasperException: No bean found under attribute key user

How do I maintain beans in the session? I've seen usually at the end of
execute Actio method code that puts beans in the session or request object.
    request.setAttribute(Constants.USER_KEY, user)

Do i have to perform that step at the end of each execute/perform method?

thanks,

dimitar


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org