Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation interceptor

 
p hasini
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does a validation interceptor provide fromt end validation or back end validation
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do we write validate() method only for back end validation?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes--it runs on the server; how would it do anything on the client?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic