Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

struts validator not working  RSS feed

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
please help me.

i'm using DispatchAction for Action and not able to implement Validator framework.

Error (using Log4j):
INFO: Installing web application at context path /rehlad from URL file:C:/jakarta-tomcat-5.0.27/webapps/rehlad
Feb 28, 2006 8:27:33 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\jakarta-tomcat-5.0.27\webapps\rehlad\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3
, section 9.7.2. Offending class: javax/servlet/Servlet.class
2006-02-28 20:27:34,413 (TilesPlugin.java:238) - Tiles definition factory loaded for module ''.
2006-02-28 20:27:34,413 (ValidatorPlugIn.java:213) - Loading validation rules file from '/WEB-INF/validator-rules.xml'
2006-02-28 20:27:34,429 (ValidatorPlugIn.java:213) - Loading validation rules file from '/WEB-INF/validation.xml'
2006-02-28 20:27:34,523 (ValidatorResources.java:247) - Add ValidatorAction: required,org.apache.struts.validator.FieldChecks

2006-02-28 20:27:34,523 (ValidatorAction.java:391) - Loading function begun
2006-02-28 20:27:34,539 (ValidatorAction.java:401) - Loading js function 'org/apache/commons/validator/javascript/validateR
equiredif.js'
2006-02-28 20:27:34,539 (ValidatorAction.java:429) - Unable to read javascript name org/apache/commons/validator/javascript
/validateRequiredif.js
2006-02-28 20:27:34,539 (ValidatorAction.java:407) - Loading javascript function completed
2006-02-28 20:27:34,539 (ValidatorResources.java:247) - Add ValidatorAction: requiredif,org.apache.struts.validator.FieldChec
ks
2006-02-28 20:27:34,539 (ValidatorResources.java:247) - Add ValidatorAction: minlength,org.apache.struts.validator.FieldCheck
s
2006-02-28 20:27:34,539 (ValidatorResources.java:247) - Add ValidatorAction: maxlength,org.apache.struts.validator.FieldCheck
s
2006-02-28 20:27:34,539 (ValidatorResources.java:247) - Add ValidatorAction: mask,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,554 (ValidatorResources.java:247) - Add ValidatorAction: byte,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,554 (ValidatorResources.java:247) - Add ValidatorAction: short,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,554 (ValidatorResources.java:247) - Add ValidatorAction: integer,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,554 (ValidatorAction.java:391) - Loading function begun
2006-02-28 20:27:34,554 (ValidatorAction.java:401) - Loading js function 'org/apache/commons/validator/javascript/validateL
ong.js'
2006-02-28 20:27:34,554 (ValidatorAction.java:429) - Unable to read javascript name org/apache/commons/validator/javascript
/validateLong.js
2006-02-28 20:27:34,554 (ValidatorAction.java:407) - Loading javascript function completed
2006-02-28 20:27:34,554 (ValidatorResources.java:247) - Add ValidatorAction: long,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,554 (ValidatorResources.java:247) - Add ValidatorAction: float,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,570 (ValidatorAction.java:391) - Loading function begun
2006-02-28 20:27:34,570 (ValidatorAction.java:401) - Loading js function 'org/apache/commons/validator/javascript/validateD
ouble.js'
2006-02-28 20:27:34,570 (ValidatorAction.java:429) - Unable to read javascript name org/apache/commons/validator/javascript
/validateDouble.js
2006-02-28 20:27:34,570 (ValidatorAction.java:407) - Loading javascript function completed
2006-02-28 20:27:34,570 (ValidatorResources.java:247) - Add ValidatorAction: double,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,586 (ValidatorResources.java:247) - Add ValidatorAction: date,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,586 (ValidatorResources.java:247) - Add ValidatorAction: range,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,586 (ValidatorResources.java:247) - Add ValidatorAction: intRange,org.apache.struts.validator.FieldChecks

2006-02-28 20:27:34,586 (ValidatorResources.java:247) - Add ValidatorAction: floatRange,org.apache.struts.validator.FieldChec
ks
2006-02-28 20:27:34,586 (ValidatorResources.java:247) - Add ValidatorAction: creditCard,org.apache.struts.validator.FieldChec
ks
2006-02-28 20:27:34,601 (ValidatorResources.java:247) - Add ValidatorAction: email,org.apache.struts.validator.FieldChecks
2006-02-28 20:27:34,633 (ValidatorResources.java:192) - Adding FormSet 'FormSet: language=null country=null variant=null
Form: FFAgencyForm
Field:
key = locationCode
property = locationCode
indexedProperty = null
indexedListProperty = null
depends = required
page = 0
fieldOrder = 0
Vars:


Form: loginForm
Field:
key = userName
property = userName
indexedProperty = null
indexedListProperty = null
depends = required
page = 0
fieldOrder = 0
Vars:

Field:
key = password
property = password
indexedProperty = null
indexedListProperty = null
depends = required
page = 0
fieldOrder = 0
Vars:
--------------------------------------------------
i'm using this:
1) In struts-config.xml

<form-beans>
<form-bean name="loginForm" type="src.com.igt.atg.web.common.LoginForm"/>
<form-bean name="FFAgencyForm" type="src.com.igt.atg.web.masters.FFAgencyForm"/>
</form-beans>

<action path="/FFAgency" type="src.com.igt.atg.web.masters.FFAgencyAction"
scope="request" name="FFAgencyForm" parameter="hmode" input="/FFAgency.jsp" validate="false">
<forward name="success" path="FFAgencyBody" />
<forward name="preview" path="FFAgencyPreviewBody" />
<forward name="save" path="MessageBody" />
<forward name="search" path="FFAgencySearchBody" />
<forward name="edit" path="FFAgencyBody" />
<forward name="failure" path="/jsp/common/login.jsp" />
</action>

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
--------------------------------------
2) Validation.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation
PUBLIC "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
<form-validation>
<formset>
<form name="loginForm">
<field property="userName" depends="required">
<arg0 key="errors.required"/>
</field>
<field property="password" depends="required">
<arg0 key="errors.password.required"/>
</field>
</form>
<form name="FFAgencyForm">
<field property="locationCode" depends="required">
<arg0 key="errors.required"/>
</field>
</form>
</formset>
</form-validation>
------------------------------------
3) in FFAgency.jsp
<html:form action="/FFAgency" method="post" onsubmit="return validateFFAgencyForm(this);">
<html:javascript formName="FFAgencyForm"/>
</html:form>
--------------------------------------
4) in FFAgencyForm.java
public class FFAgencyForm extends ActionForm
{}
-------------------------------------------
5) in FFAgencyAction.java:
public class FFAgencyAction extends DispatchAction {}
--------------------------------------------
6) in build.xml:
<pathelement location="${lib}/commons-validator.jar"/>



thanks for ur help
raminder.s
 
Your mind is under my control .... your will is now mine .... read this tiny ad
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!