File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problems with struts validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problems with struts validator" Watch "Problems with struts validator" New topic

Problems with struts validator

Janice Guevara

Joined: Aug 07, 2006
Posts: 14

I'm doing maintenance for an application.I'm trying to implement the struts validator but it doesn't work. The system has been developed to validate the forms in the actions. The problem is that when I run it with my new chages the system still calls the previous code implemented in the actions.What is happening is that the errors are captured as exceptions in a hierarchy and I don't know what to do to validate the forms with the struts validator,it is simply ignored by the system.
Do you have any suggestion?
anand kumarblr

Joined: Oct 27, 2006
Posts: 27
hi janice,
if you are using eclipse then in menu bar it will be project then clean the project and the try running it,bcoz sometimes validations will not work till that.try but i know that much only.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
My guess is that your forms do not extend ValidatorForm. If your forms just extend ActionForm then the validation framework methods will not be called.

- Brent
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
It helps if you can share what change you have made. To call the validate() method you have to set the validate attribute to true in struts-config.xml for the particular action.
[ November 03, 2006: Message edited by: Purushothaman Thambu ]
I agree. Here's the link:
subject: Problems with struts validator
It's not a secret anymore!