• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Message for you sir! I think it is a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic