File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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: 689


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:
subject: Forwarding data struts.xml
It's not a secret anymore!