You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Altenhof, David Aron" <da...@iupui.edu> on 2010/06/13 04:15:12 UTC
Convention plugin and struts.xml
Hi all,
I've been trying to find the answer to what I thought was a fairly basic question. I'd like to add some package-level configuration to packages created by the convention plugin ... things like changing the default interceptor stack and inplementing global exception handling. However, I can't figure out how to do this in struts.xml. Is this possible? To me it seems natural to have package-level configurations in the struts.xml and let the convention plugin handle the action mappings, but maybe I'm just strange. Does anyone else do this? If so, how? If you don't use struts.xml, how do you create package-level configuration?
Thanks,
David
RE: Convention plugin and struts.xml
Posted by "Altenhof, David Aron" <da...@iupui.edu>.
Thanks Pawel ... although I don't want to add the interceptors and other configuration to the default package--just to certain packages created by convention plugin. I think I just figured it out. First, you need to create the package in struts.xml and give it a name. I called it "myaccount" and I put my new interceptor stack and exception mapping there. Then You can either add this to an individual action by annotation:
@ParentPackage(value = "myaccount")
Or to all actions in the package by adding a package-info.java file to the package which includes just the following:
@org.apache.struts2.convention.annotation.ParentPackage(value = "myaccount")
package com.mysite.actions.myaccount;
Thanks for the blog link. I'll keep reading!
-David
-----Original Message-----
From: Paweł Wielgus [mailto:poulwiel@gmail.com]
Sent: Sunday, June 13, 2010 2:36 AM
To: Struts Users Mailing List
Subject: Re: Convention plugin and struts.xml
Hi David,
if You want to change the interceptor stack read this:
http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html
Best greetings,
Paweł Wielgus
2010/6/13 Altenhof, David Aron <da...@iupui.edu>:
>
> Hi all,
>
> I've been trying to find the answer to what I thought was a fairly basic question. I'd like to add some package-level configuration to packages created by the convention plugin ... things like changing the default interceptor stack and inplementing global exception handling. However, I can't figure out how to do this in struts.xml. Is this possible? To me it seems natural to have package-level configurations in the struts.xml and let the convention plugin handle the action mappings, but maybe I'm just strange. Does anyone else do this? If so, how? If you don't use struts.xml, how do you create package-level configuration?
>
> Thanks,
>
> David
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Convention plugin and struts.xml
Posted by Paweł Wielgus <po...@gmail.com>.
Hi David,
if You want to change the interceptor stack read this:
http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html
Best greetings,
Paweł Wielgus
2010/6/13 Altenhof, David Aron <da...@iupui.edu>:
>
> Hi all,
>
> I've been trying to find the answer to what I thought was a fairly basic question. I'd like to add some package-level configuration to packages created by the convention plugin ... things like changing the default interceptor stack and inplementing global exception handling. However, I can't figure out how to do this in struts.xml. Is this possible? To me it seems natural to have package-level configurations in the struts.xml and let the convention plugin handle the action mappings, but maybe I'm just strange. Does anyone else do this? If so, how? If you don't use struts.xml, how do you create package-level configuration?
>
> Thanks,
>
> David
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org