• 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

Multiple actionerror tags problem

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic