You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Castellanos <ma...@gmail.com> on 2008/02/03 19:11:30 UTC

Struts 2. Validation Issue

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.
*
*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>
            <result name="input">input.jsp</result>
            <interceptor-ref name="validationWorkflowStack"/>
        </action>*
        <action name="delete" method="delete" class="bookAction">
            <result name="success" type="redirect-action">list</result>
        </action>
    </package>

Regards

-- 
Martin Castellanos

Re: Struts 2. Validation Issue

Posted by Martin Castellanos <ma...@gmail.com>.
Thanks, I extended DefaultActionSupport and now it's working

On Feb 3, 2008 12:47 PM, Dave Newton <ne...@yahoo.com> wrote:

> --- Martin Castellanos <ma...@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 <ne...@yahoo.com> wrote:
> > > --- Martin Castellanos <ma...@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 <ne...@yahoo.com> wrote:
> > > >
> > > > > --- Martin Castellanos <ma...@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
>
>


-- 
Martin Castellanos

Re: Struts 2. Validation Issue

Posted by Dave Newton <ne...@yahoo.com>.
--- Martin Castellanos <ma...@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 <ne...@yahoo.com> wrote:
> > --- Martin Castellanos <ma...@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 <ne...@yahoo.com> wrote:
> > >
> > > > --- Martin Castellanos <ma...@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


Re: Struts 2. Validation Issue

Posted by Martin Castellanos <ma...@gmail.com>.
Oh, it's just a regular bean, doesn't implements or extends anything

On Feb 3, 2008 12:32 PM, Dave Newton <ne...@yahoo.com> wrote:

> --- Martin Castellanos <ma...@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 <ne...@yahoo.com> wrote:
> >
> > > --- Martin Castellanos <ma...@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>
> > > >             <result name="input">input.jsp</result>
> > > >             <interceptor-ref name="validationWorkflowStack"/>
> > > >         </action>
> > > >         <action name="delete" method="delete" class="bookAction">
> > > >             <result name="success"
> type="redirect-action">list</result>
> > > >         </action>
> > > >     </package>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Martin Castellanos
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Martin Castellanos

Re: Struts 2. Validation Issue

Posted by Dave Newton <ne...@yahoo.com>.
--- Martin Castellanos <ma...@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 <ne...@yahoo.com> wrote:
> 
> > --- Martin Castellanos <ma...@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>
> > >             <result name="input">input.jsp</result>
> > >             <interceptor-ref name="validationWorkflowStack"/>
> > >         </action>
> > >         <action name="delete" method="delete" class="bookAction">
> > >             <result name="success" type="redirect-action">list</result>
> > >         </action>
> > >     </package>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> Martin Castellanos
> 


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


Re: Struts 2. Validation Issue

Posted by Martin Castellanos <ma...@gmail.com>.
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


On Feb 3, 2008 12:20 PM, Dave Newton <ne...@yahoo.com> wrote:

> --- Martin Castellanos <ma...@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>
> >             <result name="input">input.jsp</result>
> >             <interceptor-ref name="validationWorkflowStack"/>
> >         </action>
> >         <action name="delete" method="delete" class="bookAction">
> >             <result name="success" type="redirect-action">list</result>
> >         </action>
> >     </package>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Martin Castellanos

Re: Struts 2. Validation Issue

Posted by Dave Newton <ne...@yahoo.com>.
--- Martin Castellanos <ma...@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>
>             <result name="input">input.jsp</result>
>             <interceptor-ref name="validationWorkflowStack"/>
>         </action>*
>         <action name="delete" method="delete" class="bookAction">
>             <result name="success" type="redirect-action">list</result>
>         </action>
>     </package>


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