This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes question about struts validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "question about struts validator" Watch "question about struts validator" New topic

question about struts validator

Nilesh Thali

Joined: Jan 13, 2009
Posts: 16
I'm still on an ancient version of struts (1.2.4), but in any case: i understand the struts validator framework being invoked when a user submits a form. my question is: if a user simply types the parameters in the URL and hits enter, would that also invoke the validator?
e.g. user just typed and hit enter, would the input be validated?
in my case it doesn't seem to.
is there any way (in terms of logs etc.) to find out if the validator was called?
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Applications using the Apache Struts framework can also be configured to use the Apache Commons Validator framework to validate HTML Form fields.

The request parameters in your URL example above are not HTML Form fields and are not validated.

In regards to data in log files, you can check to see if there is information from the form validation in a few ways. One easy way would be to create a form and configure the application to validate the form fields. Then check the log file. If you don't see anything, then set web server's log level to 'DEBUG' and then check. If you still don't see anything and you know the validation functioned correctly, then you can assume that there is no way to find out if the validation occured in terms of log files.
subject: question about struts validator
Similar Threads
Are all Singletons Bad?
Struts Validator,tag libraries help needed!
need a validator to check the number is positive
Struts2: Cannot submit action after a second validation attempt.
Unclear on what's happening with validation