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
What are the core components of a struct2 based application?
What are the reasons for an error message not being displayed while developing struts application?
Will the struts tags support other markup languages such as wml ?
What design patterns are used in struts?
What are the two scope types for formbeans?
What is package name in struts xml?
What is dispatch action class?
Describe validate() and reset() methods.
What do you mean by the abstract package in struts2, and what is its utilization?
What is action class?
What is difference between lookupdispatchaction and dispatchaction?
What is the actionform?
How can we handle exceptions thrown by application in Struts2?
Can we have more than one struts-config.xml file for a single struts application?
Explain design patterns which is used in struts?