File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes problem in displaying actionerrors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in displaying actionerrors" Watch "problem in displaying actionerrors" New topic
Author

problem in displaying actionerrors

Jordan Smith
Ranch Hand

Joined: Apr 06, 2008
Posts: 89
hi!
In my action:
UploadVideo
I add an action error like this:

then in the code i check:

in struts.xml i need it to call again the page that he came from. so i call the main action again:


but in the jsp

is empty!
could it be that the forwarding to another action made it clear the errors? how can i make it call the page again and all the methods?

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You're not forwarding, you're redirecting.

To preserve messages across redirects you can use the message store interceptor, or home-brew your own solution if it doesn't work for you. Or don't redirect.
Jordan Smith
Ranch Hand

Joined: Apr 06, 2008
Posts: 89
hi,
i implemented Message Store Interceptor like this for getVideoPage (where i need to know if there are action errors:


it works fine, but when i try to send a parameter to the action e.g. getVideoPage?videoId=3444, the videoId that i retrieve in the class is null!!
when i removed the interceptor declaration, it worked fine again.

what could be the problem?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If you define an action-specific interceptor you must define *all* interceptors for the action. If that's the only interceptor you have defined then you're missing the bulk of the Struts 2 functionality, which lives largely in its interceptors.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in displaying actionerrors