• 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

Not able to fetch the Action Error object

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

I have a scenario where in there is a struts Action (ActionB) which is a sub class of (ActionA).
ActionA is not under our control & we cannot change any code there.

The flow is something like this ActionB's execute method indirectly calls ActionA's execute & in case of error scenarios the ActionError object get constructed & populated in ActionA's execute method.

I want to retreive this ActionError object in ActionB. But I am not able to fetch the same in ActionB.
But say if call ActionA individually I can get the ActionError object in its corresponding JSP.

How can i fetch the ActionError object in such a scenario


Regards
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If ActionA's execute method calls the saveErrors() method, the ActionErrors object will be in request scope. So, if you need to access it in ActionB, you can get it from the request. Here's an example:

If you're using version 1.1:


If you're using version 1.2:

[ August 02, 2006: Message edited by: Merrill Higginson ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic