aspose file tools*
The moose likes Spring and the fly likes spring validation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "spring validation problem" Watch "spring validation problem" New topic
Author

spring validation problem

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 194
Hi All,

i am getting the below error when i submit my form. Its not possible to understand the reason of the problem through stack trace.

Aug 19, 2009 4:05:09 PM org.springmodules.validation.commons.AbstractBeanValidat
or validate
SEVERE: Exception while validating object com.tutorial.mvc.User@1342545
org.apache.commons.validator.ValidatorException: org.springmodules.commons.valid
ator.FieldChecks at org.apache.commons.validator.ValidatorAction.loadValidationClass(ValidatorAction.java:646)
at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:555)
at org.apache.commons.validator.Field.validateForRule(Field.java:827)
at org.apache.commons.validator.Field.validate(Field.java:906)
at org.apache.commons.validator.Form.validate(Form.java:174)
at org.apache.commons.validator.Validator.validate(Validator.java:367)
at org.springmodules.validation.commons.AbstractBeanValidator.validate(AbstractBeanValidator.java:63)

i dont this its because of some missing jars otherwise i would have got exception during startup.
My jsp is as follows

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<form:form commandName="user" action="/springmvc/login.htm" method="POST">
<spring:message code="first.name"></spring:message>
<form:input path="firstName"/>

<form:errors path="firstName"/>

<spring:message code="last.name"></spring:message>
<form:input path="lastName"/>

<form:errors path="lastName"/>

<input type="submit" value="Submit" />
</form:form>

validation xml is

<form-validation>
<formset>
<form name="user">
<field property="firstName" depends="required">
<arg0 key="required.firstName" />
</field>
<field property="lastName" depends="required">
<arg0 key="required.lastName" />
</field>
</form>
</formset>
</form-validation>

Please let me know if i am missing something here.

regards,
Ajse
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Try to debug what happens at org.apache.commons.validator.ValidatorAction.loadValidationClass(ValidatorAction.java:646).


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 194
I think i am not getting the java script code on my jsp. I am submitting a blank form and it should be checked on client side only.

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 194
Can any body please let me know the process of including js in my jsp files as there is no HTML tag present in Spring. Struts uses HTML tag for including js functions in jsp.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: spring validation problem