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 19:29:28 UTC

struts 2.0.9 backward compatible with struts 1.x in respect to role on action mapping

Hi,

Is role attribute supported in Struts 2? It was supported in Struts version 1.x. ( I would assume that Struts 2 is backward compatible)

If it is supported how to use it? Is there any example or documentation related to this.

Thanks,
-Akash

       
---------------------------------
Pinpoint customers who are looking for what you sell. 

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


struts.xml usage of element in element

Posted by akash agrawal <ak...@yahoo.co.uk>.
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: location of DTD/schema for struts.xml Struts 2.0.9?

Posted by James Holmes <ja...@jamesholmes.com>.
http://struts.apache.org/dtds/struts-2.0.dtd


-----Original Message-----
From: akash agrawal [mailto:akash_agrawal@yahoo.co.uk] 
Sent: Thursday, August 30, 2007 2:04 PM
To: Struts Users Mailing List
Subject: location of DTD/schema for struts.xml Struts 2.0.9?

Hi,

Where is DTD/schema for struts.xml located in S2?

I would like to check it DTD to find out what kind of tags are supported by
S2.

Thanks,
-Akash

       
---------------------------------
Pinpoint customers who are looking for what you sell. 


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


location of DTD/schema for struts.xml Struts 2.0.9?

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

Where is DTD/schema for struts.xml located in S2?

I would like to check it DTD to find out what kind of tags are supported by S2.

Thanks,
-Akash

       
---------------------------------
Pinpoint customers who are looking for what you sell. 

Re: struts 2.0.9 backward compatible with struts 1.x in respect to role on action mapping

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

Thanks for the reply. The link you mentioned does not have much detail in it.

Although, How would interceptor would solve the definition of roles information for each action in an application? If you use this interceptor you mentioned, where would you put roles information for each action?

Thanks
-Akash

Dave Newton <ne...@yahoo.com> wrote: Whoops; wrong button.

IIRC a simplistic roles interceptor [1] was added
(possibly even at my request, but it was awhile ago)
which had functionality similar to S1.

d.

[1]
http://struts.apache.org/2.x/docs/roles-interceptor.html

(Doesn't seem to be displaying properly at the moment,
though?)

--- Dave Newton  wrote:

> --- akash agrawal wrote:
> > (I would assume that Struts 2 is backward
> compatible)
> 
> S2 is a *completely* different architecture and has
> (essentially) nothing to do with S1.
> 
> d.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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



       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

Re: struts 2.0.9 backward compatible with struts 1.x in respect to role on action mapping

Posted by Dave Newton <ne...@yahoo.com>.
Whoops; wrong button.

IIRC a simplistic roles interceptor [1] was added
(possibly even at my request, but it was awhile ago)
which had functionality similar to S1.

d.

[1]
http://struts.apache.org/2.x/docs/roles-interceptor.html

(Doesn't seem to be displaying properly at the moment,
though?)

--- Dave Newton <ne...@yahoo.com> wrote:

> --- akash agrawal wrote:
> > (I would assume that Struts 2 is backward
> compatible)
> 
> S2 is a *completely* different architecture and has
> (essentially) nothing to do with S1.
> 
> d.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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


Re: struts 2.0.9 backward compatible with struts 1.x in respect to role on action mapping

Posted by Dave Newton <ne...@yahoo.com>.
--- akash agrawal wrote:
> (I would assume that Struts 2 is backward
compatible)

S2 is a *completely* different architecture and has
(essentially) nothing to do with S1.

d.


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