struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: Struts 2. Validation Issue
Date Sun, 03 Feb 2008 18:47:51 GMT
--- Martin Castellanos <martincastell@gmail.com> wrote:
> Oh, it's just a regular bean, doesn't implements or extends anything

That'll be an issue.

The workflow interceptor depends on the ValidationAware interface to decide
if it should modify the result.

Dave

> On Feb 3, 2008 12:32 PM, Dave Newton <newton.dave@yahoo.com> wrote:
> > --- Martin Castellanos <martincastell@gmail.com> wrote:
> > > Action Class is: com.maca.web.BookAction
> > > Validation file is placed next to the class:
> > BookAction-save-validation.xml
> > > Validation file for the book entity is: Book-validation.xml and it's
> > placed
> > > next to the Book class
> >
> > "Signature" means "How is your class defined?" What does it extend? What
> > does
> > it implement?
> >
> > Dave
> >
> > > On Feb 3, 2008 12:20 PM, Dave Newton <newton.dave@yahoo.com> wrote:
> > >
> > > > --- Martin Castellanos <martincastell@gmail.com> wrote:
> > > > > Hi, I'm trying to use the xml validation, the validation is
> > executing
> > > > and
> > > > > detecting errors, but after the validation the method save gets
> > called
> > > > > instead of invoking the input action it's executing the 'success'
> > > > action.
> > > > > I've tried several things but still can't see what's missing, I'm
> > using
> > > > > Spring as the object factory. I'd appreciate any help.
> > > >
> > > > What's the signature of your action class?
> > > >
> > > > Dave
> > > >
> > > > > *
> > > > > *DEBUG [http-8084-4] (ValidationInterceptor.java:134) - Validating
> > > > > /books/save with method save.
> > > > > DEBUG [http-8084-4] (DefaultListableBeanFactory.java:354) - No bean
> > > > named '
> > > > > com.opensymphony.xwork2.validator.validators.VisitorFieldValidator'
> > > > found
> > > > > in
> > > > >
> > > >
> > > >
> > >
> >
> org.springframework.beans.factory.support.DefaultListableBeanFactory@e4d7f7
> > > > :
> > > > > defining beans
> > > > >
> > > >
> > >
> >
> [propertyConfigurer,bookDataSource,bookSessionFactory,bookDao,bookAction];
> > > > > root of factory hierarchy
> > > > > DEBUG [http-8084-4] (CollectionFactory.java:114) - Creating [
> > > > > java.util.LinkedHashMap]
> > > > > DEBUG [http-8084-4] (AbstractAutowireCapableBeanFactory.java:892)
-
> > Not
> > > > > autowiring property 'validatorContext' of bean '
> > > > > com.opensymphony.xwork2.validator.validators.VisitorFieldValidator'
> > by
> > > > > name:
> > > > > no matching bean found
> > > > > DEBUG [http-8084-4] (AnnotationActionValidatorManager.java:146) -
> > > > Running
> > > > > validator:
> > > > >
> > > >
> > > >
> > >
> >
> >
>
com.opensymphony.xwork2.validator.validators.VisitorFieldValidator@1d2052bfor
> > > > > object
> > > > > com.maca.web.BookAction@74a138 and method null
> > > > > DEBUG [http-8084-4] (DefaultListableBeanFactory.java:354) - No bean
> > > > named '
> > > > >
> com.opensymphony.xwork2.validator.validators.RequiredStringValidator
> > '
> > > > found
> > > > > in
> > > > >
> > > >
> > > >
> > >
> >
> org.springframework.beans.factory.support.DefaultListableBeanFactory@e4d7f7
> > > > :
> > > > > defining beans
> > > > >
> > > >
> > >
> >
> [propertyConfigurer,bookDataSource,bookSessionFactory,bookDao,bookAction];
> > > > > root of factory hierarchy
> > > > > DEBUG [http-8084-4] (CollectionFactory.java:114) - Creating [
> > > > > java.util.LinkedHashMap]
> > > > > DEBUG [http-8084-4] (AbstractAutowireCapableBeanFactory.java:892)
-
> > Not
> > > > > autowiring property 'validatorContext' of bean '
> > > > >
> com.opensymphony.xwork2.validator.validators.RequiredStringValidator
> > '
> > > by
> > > > > name: no matching bean found
> > > > > DEBUG [http-8084-4] (DefaultListableBeanFactory.java:354) - No bean
> > > > named '
> > > > >
> com.opensymphony.xwork2.validator.validators.RequiredStringValidator
> > '
> > > > found
> > > > > in
> > > > >
> > > >
> > > >
> > >
> >
> org.springframework.beans.factory.support.DefaultListableBeanFactory@e4d7f7
> > > > :
> > > > > defining beans
> > > > >
> > > >
> > >
> >
> [propertyConfigurer,bookDataSource,bookSessionFactory,bookDao,bookAction];
> > > > > root of factory hierarchy
> > > > > DEBUG [http-8084-4] (CollectionFactory.java:114) - Creating [
> > > > > java.util.LinkedHashMap]
> > > > > DEBUG [http-8084-4] (AbstractAutowireCapableBeanFactory.java:892)
-
> > Not
> > > > > autowiring property 'validatorContext' of bean '
> > > > >
> com.opensymphony.xwork2.validator.validators.RequiredStringValidator
> > '
> > > by
> > > > > name: no matching bean found
> > > > > DEBUG [http-8084-4] (AnnotationActionValidatorManager.java:146) -
> > > > Running
> > > > > validator:
> > > > >
> > > >
> > > >
> > >
> >
> >
>
com.opensymphony.xwork2.validator.validators.RequiredStringValidator@13a1324for
> > > > > object
> > > > > com.maca.model.Book@1871a69 and method null
> > > > > ERROR [http-8084-4] (DelegatingValidatorContext.java:279) -
> > Validation
> > > > > error
> > > > > for book.book.title:Book title is required
> > > > > DEBUG [http-8084-4] (AnnotationActionValidatorManager.java:146) -
> > > > Running
> > > > > validator:
> > > > >
> > > >
> > > >
> > >
> >
> >
>
com.opensymphony.xwork2.validator.validators.RequiredStringValidator@1f18cd5for
> > > > > object
> > > > > com.maca.model.Book@1871a69 and method null
> > > > > ERROR [http-8084-4] (DelegatingValidatorContext.java:279) -
> > Validation
> > > > > error
> > > > > for book.book.description:Book description is required
> > > > > DEBUG [http-8084-4] (DefaultActionInvocation.java:383) - Executing
> > > > action
> > > > > method = save
> > > > >
> > > > >
> > > > > This is a snippet from my struts.xml
> > > > >
> > > > > <package name="books" extends="struts-default" namespace="/books">
> > > > >
> > > > >         <!-- Default interceptor stack. -->
> > > > >         <default-interceptor-ref name="basicStack"/>
> > > > >
> > > > >         <action name="list" method="list" class="bookAction">
> > > > >             <result>list.jsp</result>
> > > > >         </action>
> > > > >         <action name="input" method="input" class="bookAction">
> > > > >             <result name="success"
> > type="redirect-action">list</result>
> > > > >             <result name="input">input.jsp</result>
> > > > >         </action>
> > > > >         <action name="edit" method="edit" class="bookAction">
> > > > >             <result name="success"
> > type="redirect-action">list</result>
> > > > >             <result name="input">input.jsp</result>
> > > > >         </action>
> > > > >         <action name="save" method="save" class="bookAction">
> > > > >             <result name="success"
> > type="redirect-action">list</result>
> 
=== message truncated ===


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message