How to carryout the validations in struts if the validator
frame work cant handle the validation

Answers were Sorted based on User's Feedback



How to carryout the validations in struts if the validator frame work cant handle the validation..

Answer / 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

How to carryout the validations in struts if the validator frame work cant handle the validation..

Answer / sitaram

There are two types of validations in Struts.
1.by using validator method in form bean.
2.by using validator.XML file in the struts. that
vlalidators are declared in validator.XML.
The validator frame work handle the validation. he
validation are declaring in validator.xml.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Struts Interview Questions

What are the differences between Struts1 and Struts2 or how Struts2 is better than Struts1?

0 Answers  


How many types of action clases are there in stuts and their uses?

15 Answers   OHO, TCS, Wipro,


What are disadvantages of Struts?

0 Answers  


How do you find the struts version being used in a project?

0 Answers  


what is mean by custom tag?

5 Answers   Wipro,


what is the purpose of load_on_startup entry in struts- config.xml?

8 Answers   Satyam,


Is there a particularly good ide to use with struts?

0 Answers  


What is the purpose of action tag in struts.xml?

0 Answers  


wat happen when the connection is nt closed in jdbc n what vl happen when i interchange in executequery n execute statements

2 Answers  


What is role of action class?

0 Answers  


What is package name in struts xml?

0 Answers  


What’s the utilization of struts.xml configuration file?

0 Answers  


Categories