Reputation: 7590
I'm doing some operations in my action and want to show an error message when some data input are not in the valid range. We usually do a pre-checking with a javascript method but in this case i can't reach the values of the variables i need to check.
The part of the webpage to show the error message is a strut part
Thanks in advance
Upvotes: 1
Views: 156
Reputation: 6525
You can use form validate method for validating .Before submitting the form it will check your condition.
Example :-
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
//Write your code for range checking here
return errors;
}
Except , this method few setting you have to do with ApplicationResources.property file
Upvotes: 1