You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JP Cafaro <jc...@gmail.com> on 2010/07/14 21:28:35 UTC

ParentPackage annotation not applying to subpackages

I'm using struts 2 with convention plugin.  The convention plugin page 
states for the ParentPackage annotation, "To apply this annotation to 
all actions in a package (and subpackages), add it to 
package-info.java."  I have two packages, my-default and my-secure.  I 
have a package called actions.secure and in it I have a 
package-info.java with a ParentPackage annotation for "my-secure".  
However, I have subpackages, actions.secure.view, etc. and in order for 
them to think they are also part of "my-secure", they need their own 
package-info.java file.  This is annoying.  How do I make the 
package-info.java apply to all of the subpackages like the convention 
page says.

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


Re: ParentPackage annotation not applying to subpackages

Posted by JP Cafaro <jc...@gmail.com>.
But now you have only one package and your interceptor has to check the 
namespace to see whether or not it should work.  What if you want to do 
different things for different packages? Now you only have one.  I guess 
it's one idea, although I'd be happier just getting the 
package-info.java to do what it says it should do according to the 
convention plugin documentation...

Paweł Wielgus wrote:
> Hi,
> all i can advice is to use default parent package.
> I described it here:
> http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2010/7/14 JP Cafaro <jc...@gmail.com>:
>   
>> I'm using struts 2 with convention plugin.  The convention plugin page
>> states for the ParentPackage annotation, "To apply this annotation to all
>> actions in a package (and subpackages), add it to package-info.java."  I
>> have two packages, my-default and my-secure.  I have a package called
>> actions.secure and in it I have a package-info.java with a ParentPackage
>> annotation for "my-secure".  However, I have subpackages,
>> actions.secure.view, etc. and in order for them to think they are also part
>> of "my-secure", they need their own package-info.java file.  This is
>> annoying.  How do I make the package-info.java apply to all of the
>> subpackages like the convention page says.
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>   

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


Re: ParentPackage annotation not applying to subpackages

Posted by Paweł Wielgus <po...@gmail.com>.
Hi,
all i can advice is to use default parent package.
I described it here:
http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html

Best greetings,
Paweł Wielgus.


2010/7/14 JP Cafaro <jc...@gmail.com>:
> I'm using struts 2 with convention plugin.  The convention plugin page
> states for the ParentPackage annotation, "To apply this annotation to all
> actions in a package (and subpackages), add it to package-info.java."  I
> have two packages, my-default and my-secure.  I have a package called
> actions.secure and in it I have a package-info.java with a ParentPackage
> annotation for "my-secure".  However, I have subpackages,
> actions.secure.view, etc. and in order for them to think they are also part
> of "my-secure", they need their own package-info.java file.  This is
> annoying.  How do I make the package-info.java apply to all of the
> subpackages like the convention page says.
>
> ---------------------------------------------------------------------
> 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