wood burning stoves 2.0*
The moose likes Struts and the fly likes Forwarding data struts.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Forwarding data struts.xml" Watch "Forwarding data struts.xml" New topic

Forwarding data struts.xml

shaf maff
Ranch Hand

Joined: Sep 07, 2008
Posts: 180
Hi Guys,

I hava login action which logs the user in, loads his data and then moves onto the JSP where it is displayed. I have come across one problem though with the struts. If I set my struts to the following:

In the login action, the final result is to forward to manager.jsp. This works perfectly fine. But if I use <result name="manager" type="redirect">ManagerPanel.action</result> in the place of <result>/main/user/manager.jsp</result> the data is not forwarded to the JSP. does anyone know why ? And how I can correct this?

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 684


First of all when you redirect your action then you can not get any of your actionError, actionMessage and any of your action variable value.

You have to use either <result>/main/user/manager.jsp</result> jsp or

<result name="manager" type="chain">ManagerPanel</result>

this will solve your problem.

So, remove your result type="redirect"

I am not sure about chain.

But if you use chain may be you can get data.

Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
I agree. Here's the link: http://aspose.com/file-tools
subject: Forwarding data struts.xml
Similar Threads
struts2: howto correctly deligate actions on the struts.xml's include files
Struts2 newbie - HTTP Status 404 - No result defined for action authentication.User and result SUCCE
problem in combining <jsp:include> and struts 2.2.1
Checking page sessions
Redirects in Inceptor