• 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

customize html:errors tag

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a complicated form that i have had to spans across 4 jsp pages. All the information from the 4 forms is stored within one ActionForm bean. The user has freedom to move about from one form to another. I do my validation only when the user clicks on submit on any one of the pages. Now here is the situation, let's say there was invalid entry on jsp page 1 and jsp page 3. Then in that case when i am in jsp page 1 i just want to show errors related to jsp page 1, and when i am at jsp page 3 i want to show errors related to page 3. How can i customize my tag to be able to handle this situation. Please advise.
Thank you
 
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when creating the errors, give them the same name.
Eg.
actionErrors.addError("page1errors", new ActionError("form.required", "username"));
actionErrors.addError("page1errors", new ActionError("form.required", "password"));
etc
<html:errors property="page1errors"/>
 
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic