aspose file tools*
The moose likes Struts and the fly likes Validation interceptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validation interceptor" Watch "Validation interceptor" New topic
Author

Validation interceptor

p hasini
Ranch Hand

Joined: Oct 24, 2009
Posts: 92
Does a validation interceptor provide fromt end validation or back end validation
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

How would an interceptor, running on the server during the request cycle, provide front-end validation, running on the client?

In any case, the validation interceptor does back-end validation.
p hasini
Ranch Hand

Joined: Oct 24, 2009
Posts: 92
During validation,we use Validation interceptor.This interceptor displays the messages from Actionclass-validation.xml file.

Then what is the use of validate() method in oour Action class.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No, the validation interceptor initiates the server-side validation. Tags in the JSP display the messages.

The validate() method can be used to run custom validation, including business logic, etc. for which the validation XML or annotation configuration isn't suitable.
p hasini
Ranch Hand

Joined: Oct 24, 2009
Posts: 92
Do we write validate() method only for back end validation?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yes--it runs on the server; how would it do anything on the client?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Validation interceptor