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
Can you explain struts validator framework?
How to override the default error message that can come during file uploading process?
What are the steps of struts installation?
What is the default location of result pages and how can we change it?
Which tag is used to declare constants in struts xml?
What are the conditions for actionform to work correctly?
How many Action classes have been used in your project? Differences between struts 1.1 and 1.3?
What is actionform in struts?
Which class is the Front Controller in Struts2?
Is Struts Framework part of J2EE?
How can you create your custom interceptor in struts 2?
What are the benefits of Interceptors in Struts2?
What configuration changes are required to use Tiles in Struts?
What are the classes used in struts?
What is request processor and how does it relates to action mapping?