One thing you can do is use the <param> tag in struts.xml (along with
the staticParams interceptor from the defaultStack) to inject the
value of a parameter into your action.

If you have something like this in your struts.xml:

<action name="login" class="my.company.controller.LoginAction">
  <param name="role">anybody</param>
  <result>home.jsp</result>
</action>

And then you add a setRole(String role) method to your LoginAction, it
will automatically be populated for you by the time your
LoginAction.execute() method is called.
  (*Chris*)

On Jan 10, 2008 5:48 AM, Manoel Pimentel <[EMAIL PROTECTED]> wrote:
>
> Hi Friends,
>
> I did one small workaround, I used the
> "ServletActionContext.getActionMapping().getName()" for catch the name of my
> action and as i have two element action using the same action class,  this
> way work well.
> But, I still can't catch the value into the param element.
>
> Tks,
>
> Manoel Pimentel
> www.visaoagil.com
>
>
>
>
> Manoel Pimentel wrote:
> >
> > Hi to everyone,
> >
> > Please, I need help :-).
> >
> > Like are possible catch the values in a session using the
> > "ActionContext.getContext().getSession()", I want to know if have any way
> > to catch in a action class, the value of one parameter set in the
> > struts.xml file?
> >
> > Example:
> > I need use in my Action class, the value set in a tag like: XLS inside a
> > action element.
> >
> > Thanks for any help, ok?
> >
> > Manoel Pimentel
> > www.visaoagil.com
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Catch-the-element-param-in-a-action-class-tp14716540p14733722.html
>
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to