You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Juanjo Cuadrado <jj...@gmail.com> on 2008/10/29 17:09:25 UTC

Re: How to recover the action's name executed [SOLVED]

It works!!!

Thanks.

2008/10/29 hernan gonzalez <hg...@gmail.com>

> I wrote  "validate programatically", it's rather trivial, though
> perhaps does not mix well with
> declarative validation, if you are using it. For example
>
>
> public class MyAction extends ActionSupport implements Validateable  {
>
>  public String method1() throws Exception  {
>       validate1();
>       if(hasErrors()) return INPUT;
>       ... // real method1 work
>  }
>
>  public String method2() throws Exception  {
>       validate2();
>       if(hasErrors()) return INPUT;
>       ... // real method1 work
>  }
>
>
>  public void validate1() {
>         ...
>  }
>
>  public void validate2() {
>         ...
>  }
>
>  public void validate () {
>         // common validation for every method
>   }
>
> }
>
>
> On Wed, Oct 29, 2008 at 11:52 AM, Juanjo Cuadrado <jj...@gmail.com>
> wrote:
> > uuummm... yes... but.. how?
> >
> > have you documentation this?
> >
> > 2008/10/29 hernan gonzalez <hg...@gmail.com>
> >
> >> If you need to execute different validation for each method, would'n
> >> it  be more
> >> pertinent to validate programatically, invoking the corresponding
> >> validation method
> >> from each action method ?
> >>
> >>
> >> On Wed, Oct 29, 2008 at 10:55 AM, Juanjo Cuadrado <jjcuadrado@gmail.com
> >
> >> wrote:
> >> > Hi,
> >> >
> >> > I need to know how to recover (from the validation method) the name of
> de
> >> > action that has been invoked. I want to know the name of the method
> that
> >> > will be executed for this action (in the struts.xml I have put
> diferents
> >> > methods for the same action class).
> >> >
> >> > Thanks.
> >> >
> >>
> >>
> >>
> >> --
> >> Hernán J. González
> >> http://hjg.com.ar/
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
>
>
> --
> Hernán J. González
> http://hjg.com.ar/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: How to recover the action's name executed [SOLVED]

Posted by Arpan Debroy <ar...@gmail.com>.
When you say it works then you should say how you did that.
Because others may be looking for the solution for your problem.

On Wed, Oct 29, 2008 at 9:39 PM, Juanjo Cuadrado <jj...@gmail.com>wrote:

> It works!!!
>
> Thanks.
>
> 2008/10/29 hernan gonzalez <hg...@gmail.com>
>
> > I wrote  "validate programatically", it's rather trivial, though
> > perhaps does not mix well with
> > declarative validation, if you are using it. For example
> >
> >
> > public class MyAction extends ActionSupport implements Validateable  {
> >
> >  public String method1() throws Exception  {
> >       validate1();
> >       if(hasErrors()) return INPUT;
> >       ... // real method1 work
> >  }
> >
> >  public String method2() throws Exception  {
> >       validate2();
> >       if(hasErrors()) return INPUT;
> >       ... // real method1 work
> >  }
> >
> >
> >  public void validate1() {
> >         ...
> >  }
> >
> >  public void validate2() {
> >         ...
> >  }
> >
> >  public void validate () {
> >         // common validation for every method
> >   }
> >
> > }
> >
> >
> > On Wed, Oct 29, 2008 at 11:52 AM, Juanjo Cuadrado <jj...@gmail.com>
> > wrote:
> > > uuummm... yes... but.. how?
> > >
> > > have you documentation this?
> > >
> > > 2008/10/29 hernan gonzalez <hg...@gmail.com>
> > >
> > >> If you need to execute different validation for each method, would'n
> > >> it  be more
> > >> pertinent to validate programatically, invoking the corresponding
> > >> validation method
> > >> from each action method ?
> > >>
> > >>
> > >> On Wed, Oct 29, 2008 at 10:55 AM, Juanjo Cuadrado <
> jjcuadrado@gmail.com
> > >
> > >> wrote:
> > >> > Hi,
> > >> >
> > >> > I need to know how to recover (from the validation method) the name
> of
> > de
> > >> > action that has been invoked. I want to know the name of the method
> > that
> > >> > will be executed for this action (in the struts.xml I have put
> > diferents
> > >> > methods for the same action class).
> > >> >
> > >> > Thanks.
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Hernán J. González
> > >> http://hjg.com.ar/
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>
> > >
> >
> >
> >
> > --
> > Hernán J. González
> > http://hjg.com.ar/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>