How to carryout the validations in struts if the validator
frame work cant handle the validation
Answer Posted / srilatha ghanta
Struts supports two types of validation
1)"pro grammatical validations" ,performed using
validate()method in form bean.
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
}
validate method return type is ActionErrors ,it holds set of
ActionError objects.
2)"declarative validations" ,handled by struts frame work only.
Struts provides a XML file validator-rules.xml which
contains standard validation methods
so this fie is configured into our application like this in
struts-config.xml file using <plug-in >tag.
we are having the responsibility inform to framework which
validations only u are using in Ur applications.that
particular keys can be defined in validation.xml file.
this file also configured in struts-config.xml
<plug-in
className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/org/apache/struts/validator/validator-rules.xml,
/WEB-INF/validation.xml" />
</plug-in>
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
how to develop the submit and search operations in single jsp using struts?
What are the different kinds of actions in struts?
How to override the default error message that can come during file uploading process?
What is the purpose of execute method of action class?
At the point, you should go for struts framework?
How does struts work?
Describe the basic steps used to create a tiles application?
What is the default suffix for struts2 action uri ?
What is interceptor? And life cycle methods of interceptor?
What is meant by custom tags?
Can we have multiple struts config files ?
Give an example where struts tiles may be used?
What is xml based validation in struts2?
What is the procedure of operation of a form tag?
What are the Core classes of Struts Framework?