Felix-

IIOC, a forward forwards the original request, hence, why you are able to
see the attributes you set whereas a redirect sends a new request which
means you lose the attributes.

I think this question was posted previously in the last week or so, so check
the list archives for then.

-Adam
 
-----Original Message-----
From: Felix Khazin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 20 July 2006 13:47
To: user@struts.apache.org
Subject: Struts forward and redirect

Hi all,

I have a quick question:

My struts-config.xml has a forward line such as:

<forward name="show" path="/application.do"/>

In my controller if I set an attribute such as:

Request.setAttribute("test", "test string");

Return (mapping.findForward("show"));

This works fine and I am able to use test in the view.

But if I change the forward to "redirect=true" this functionality
disappears and I am no longer able to use the attributes set in the
controller.

Does anyone know why I can't do this with a redirect, and how I may be
able to still use a redirect and get the attributes in the view?

Thank you very much!

Felix

Reply via email to