• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in displaying actionerrors

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic