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 client side validation is enabled on a jsp form?
What is defeult result type?
What is the purpose of @keyproperty annotation annotation?
What is package name in struts xml?
Explain the difference between dispatchaction and lookupdispatchaction in struts?
What is the use of form bean in struts?
What does params interceptor?
Can you give an overview of how a struts application flows?
What is the purpose of '@keyproperty'?
How is the mvc design pattern used in struts framework?
What are the major differences between html tags and strut specific html tags?
Explain about the future of struts?
What is the procedure of operation of a form tag?
What are action errors?
How do u provide security to ur project?(Banking domain project)