• 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

Question regarding Struts Validator

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I am following the TwoField Pluggable Struts Validator example mentioned in dev guide of Struts.

I found that even when my fields are different, there are no errors shown on my JSP. So, I debugged and found that in the method of the validator class I wrote, the code abruptly stops at the line
"errors.add(field.getKey(), new ActionMessage("aerrors.twofields", value, value2));" and the page forwards to the success page.

Here's the method code


Am I doing anything wrong? The only difference between the example available on Struts code and this is that I replaced delegated errors.add(..) method with another one.

Thanks for your time,
Kiran
 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I fixed that issue by instantiating ActionError object as it was null before. But even when the method returns a "false", I am being forwarded to the success page. Here's my action mappings in the config file.


Is there some other setting that I need to do?
Thanks,
Kiran
 
Who among you feels worthy enough to be my best friend? Test 1 is to read 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