You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by akash agrawal <ak...@yahoo.co.uk> on 2007/08/30 21:00:46 UTC

struts.xml usage of element in element

Hi,

Can someone explain me the usage of <param> element under <action> element? How to access it property inside java action?

Is this a valid config?
<action>
    <param name="roles">xyz, abc1, abc2</param>
</action>
How to access roles property in an action class?

Thanks,
-Akash

       
---------------------------------
Shape Yahoo! in your own image.  Join our Network Research Panel today!

Re: struts.xml usage of element in element

Posted by Chris Pratt <th...@gmail.com>.
> When would this setter be called? Can I access this property inside an interceptor (custom interceptor/pre-packaged interceptor)? (This would help to check it before execute is called)
>

I believe it is called by the ParamInterceptor, so as long as your
interceptor is later in the stack, the value should be set.
  (*Chris*)

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


Re: struts.xml usage of element in element

Posted by akash agrawal <ak...@yahoo.co.uk>.
Chris,

When would this setter be called? Can I access this property inside an interceptor (custom interceptor/pre-packaged interceptor)? (This would help to check it before execute is called)

Thanks.

Chris Pratt <th...@gmail.com> wrote: Yes, setRole(String role) for my example.
  (*Chris*)

On 8/30/07, akash agrawal  wrote:
> Hi,
>
> Thanks for the reply Chris.
>
> Do you mean providing a setter like setRole(String role) or setRoles(String role) would do?
>
> When would this setter be called? If I define an interceptor, Can I check for this property inside interceptor before my execute() is called?
>
> Thanks,
> -Akash
>
> Chris Pratt  wrote: Just create a mutator in your action and Struts will populate the
> value for you automatically.  I use this to set the Role into my base
> action
>
>
>
> admin
>
>
>   (*Chris*)
>
> On 8/30/07, akash agrawal  wrote:
> > Hi,
> >
> > Can someone explain me the usage of
>  element under  element? How to access it property inside java action?
> >
> > Is this a valid config?
> >
> >
> xyz, abc1, abc2
> >
> > How to access roles property in an action class?
> >
> > Thanks,
> > -Akash
> >
> >
> > ---------------------------------
> > Shape Yahoo! in your own image.  Join our Network Research Panel today!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------
> Need a vacation? Get great deals to amazing places on Yahoo! Travel.

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



       
---------------------------------
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out. 

Re: struts.xml usage of element in element

Posted by Chris Pratt <th...@gmail.com>.
Yes, setRole(String role) for my example.
  (*Chris*)

On 8/30/07, akash agrawal <ak...@yahoo.co.uk> wrote:
> Hi,
>
> Thanks for the reply Chris.
>
> Do you mean providing a setter like setRole(String role) or setRoles(String role) would do?
>
> When would this setter be called? If I define an interceptor, Can I check for this property inside interceptor before my execute() is called?
>
> Thanks,
> -Akash
>
> Chris Pratt <th...@gmail.com> wrote: Just create a mutator in your action and Struts will populate the
> value for you automatically.  I use this to set the Role into my base
> action
>
>
>
> admin
>
>
>   (*Chris*)
>
> On 8/30/07, akash agrawal  wrote:
> > Hi,
> >
> > Can someone explain me the usage of
>  element under  element? How to access it property inside java action?
> >
> > Is this a valid config?
> >
> >
> xyz, abc1, abc2
> >
> > How to access roles property in an action class?
> >
> > Thanks,
> > -Akash
> >
> >
> > ---------------------------------
> > Shape Yahoo! in your own image.  Join our Network Research Panel today!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------
> Need a vacation? Get great deals to amazing places on Yahoo! Travel.

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


Re: struts.xml usage of element in element

Posted by akash agrawal <ak...@yahoo.co.uk>.
Hi,

Thanks for the reply Chris.

Do you mean providing a setter like setRole(String role) or setRoles(String role) would do?

When would this setter be called? If I define an interceptor, Can I check for this property inside interceptor before my execute() is called?

Thanks,
-Akash

Chris Pratt <th...@gmail.com> wrote: Just create a mutator in your action and Struts will populate the
value for you automatically.  I use this to set the Role into my base
action


  
admin


  (*Chris*)

On 8/30/07, akash agrawal  wrote:
> Hi,
>
> Can someone explain me the usage of 
 element under  element? How to access it property inside java action?
>
> Is this a valid config?
> 
>     
xyz, abc1, abc2
> 
> How to access roles property in an action class?
>
> Thanks,
> -Akash
>
>
> ---------------------------------
> Shape Yahoo! in your own image.  Join our Network Research Panel today!

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



       
---------------------------------
Need a vacation? Get great deals to amazing places on Yahoo! Travel. 

Re: struts.xml usage of element in element

Posted by Chris Pratt <th...@gmail.com>.
Just create a mutator in your action and Struts will populate the
value for you automatically.  I use this to set the Role into my base
action

<action name="myaction">
  <param name="role">admin</param>
</action>

  (*Chris*)

On 8/30/07, akash agrawal <ak...@yahoo.co.uk> wrote:
> Hi,
>
> Can someone explain me the usage of <param> element under <action> element? How to access it property inside java action?
>
> Is this a valid config?
> <action>
>     <param name="roles">xyz, abc1, abc2</param>
> </action>
> How to access roles property in an action class?
>
> Thanks,
> -Akash
>
>
> ---------------------------------
> Shape Yahoo! in your own image.  Join our Network Research Panel today!

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