The moose likes Struts and the fly likes Problems with validation and dispatchAction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problems with validation and dispatchAction" Watch "Problems with validation and dispatchAction" New topic

Problems with validation and dispatchAction

Trent Cioran

Joined: Sep 01, 2004
Posts: 2
i have a DispatchAction wich contains all the functionality of one object and a validator but i need the validator only acts over a few of my methods, how can i do this??? because it is active all the time i can retrieve data i need to populate como boxes and other operations that don't need this validations.

David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
First, turn off validation in the struts-config.xml file. Next, manually invoke the validation in those methods where you need it using the following pattern:

"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The team, Newsletter 039.
I agree. Here's the link:
subject: Problems with validation and dispatchAction
It's not a secret anymore!