This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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 checked out Aspose?
 
subject: Struts 2 - Custom Validation Method
 
It's not a secret anymore!