This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Action errors and a message
Similar Threads
struts validation
ActionErrors (Struts)
Unable to generate error from Action class !
Action Forms Vs html pages
how to access actionErrors in Struts2?