aspose file tools
The moose likes Struts and the fly likes Accessing ActionErrors in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Accessing ActionErrors in JSP" Watch "Accessing ActionErrors in JSP" New topic
Author

Accessing ActionErrors in JSP

Adam Richards
Ranch Hand

Joined: Nov 03, 2005
Posts: 133
I'd like to implement my own display of ActionErrors in a JSP, rather than use the <html:errors> tag. My question is: How to I access the ActionErrors from a JSP under Struts 1.0 (yeah, I know it's ancient, but I'm supporting a legacy app).
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Grab them from the request (session?) the same way the tag does; using constants defined here.

If you need to refer to the source it's available via SVN here.
Adam Richards
Ranch Hand

Joined: Nov 03, 2005
Posts: 133
Since I posted this, I realized the simpler way to do what I need is to specif a bundle attribute on the <html:errors> tag. The problem's a little complicated: I'm trying to incrementally convert a legacy app to a new error display style. So what I came up with is to use a separate resource bundle with the new errors.header and errors.footer strings. I think that will work, but now I can't get Struts to recognize that I'm deliberately creating an error (for testing). I'll start a new thread on that. But thanks for the quickly reply!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Accessing ActionErrors in JSP
 
Similar Threads
ActionError issue
saveErrors method in Action class
Exception Handling
Validation in Struts 2
struts 2 validation