File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Action errors and a message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action errors and a message" Watch "Action errors and a message" New topic

Action errors and a message

Javier Pascual

Joined: Jan 07, 2007
Posts: 8
Let's say I have an action which can generate some action errors, and I want to print these errors in the view.

I could use the actionError tag to do this, but, is there a parameter or something to be able to add a message like "These errors occurred" only when you have errors?

Or should I use hasActionErrors() and s:iterator to print the action errors by myself?
David Newton

Joined: Sep 29, 2008
Posts: 12617

Use an "if" to see if there are errors and display an error message if there are.
I agree. Here's the link:
subject: Action errors and a message
It's not a secret anymore!