Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

spring validation problem

 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to debug what happens at org.apache.commons.validator.ValidatorAction.loadValidationClass(ValidatorAction.java:646).
 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic