Question
How client side validation is enabled on a JSP form?

Answers

In order to enable client side validation in Struts, first we need to enable validator plug-in in struts-config.xml file. This is done by adding following configuration entries in this file:
XHTML
<!--  Validator plugin -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in> 123456
<!--  Validator plugin --><plug-in className="org.apache.struts.validator.ValidatorPlugIn"><set-propertyproperty="pathnames"value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/></plug-in>

 
Then Validation rules are defined in validation.xml file. If a form contains email field and we want to enable client side validation for this field, following code is added in validation.xml file:
XHTML
<form name="testForm">
<field  property="email"
depends="required">
<arg key="testForm.email"/>
</field>
</form> 123456
<form name="testForm"><field  property="email"depends="required"><arg key="testForm.email"/></field></form>

    Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Can rom be used as stack?
  • Q Which college are you from?
  • Q What professional groups are you a member of, and how active have you been in those groups?
  • Q Who carried the British flag at the closing ceremony of the 2004 Summer Olympic Games?
  • Q What kinds of tests?
  • Q What are alerts?
  • Q List the importance of evaluating an internal audit department?
  • Q Give the floral formula of Triuridaceae ?
  • Q Is des a group?
  • Q In which chloroplast structure are chlorophyll molecules found?
  • Q Do tornadoes really stay away from gullies, rivers and mountains?