aspose file tools
The moose likes Struts and the fly likes Struts 2 - Custom Validation Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 - Custom Validation Method" Watch "Struts 2 - Custom Validation Method" New topic
Author

Struts 2 - Custom Validation Method

Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740
    
  10

I have complex validation logic I'd like to process by overriding the validate() method. If errors are found, how are they reported to the JSP? Right now, I can throw exceptions (which works) but leaves a stack trace on the screen instead of indicating which JSP fields have issues.


[OCA 8 Book] [Blog]
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740
    
  10

Nevermind, found addFieldError(fieldName,message) to use. I wonder why I'm having such trouble finding documentation... sigh... Hopefully these posts are helping someone out there.
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Struts 2 - Custom Validation Method