Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple actionerror tags problem

 
shaf maff
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

On one of my pages I have two forms and each for has <s:actionerror /> tag. The problem is if the action class returns an error, the error message is displayed on both actionerror tags. How can I set it so only the form being used outputs the error?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Action errors are per-action, not per-form: as such there's only one collection of error messages--there's no way to differentiate them.

There are a few options. One would be to use pseudo-field errors, using a field name that doesn't actually exist in either form, and use the <s:fielderror...> tag, looking for the pseudo-field error. Another would be to just handle it manually.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic