In 2.0.11 the Codebehind plugin was just a .... UnknownHandler ;-) Try add this: <constant name="struts.configuration.classpath.defaultParentPackage" value="basicstruts2"/>
And you don't have to include "struts-plugin.xml" - framework does it for you ;-) Regards -- Ćukasz + 48 606 323 122 http://www.lenart.org.pl/ 2013/10/22 Greuel, Jim <jim_gre...@fws.gov>: > I know the Codebehind plugin was deprecated long ago, but we have an old, > large app running on Struts 2.0.11 that uses it. With the security fix in > 2.3.15.1 we are now compelled to upgrade the struts version on this app, > though we'd like to continue using the Codebehind plugin (the app is large > enough to make migration to the Conventions plugin costly). The app makes > use of the @ParentPackage, @NameSpace and @Result annotations. The > @ParentPackage annotation seems to no longer work after the migration. > > Before submitting a bug report, I thought I'd check to see if anyone else > has encountered this issue. > > I have a sample app, based on the Struts HelloWorld example, that exhibits > the behavior. It creates and uses a custom struts package that makes use of > the paramsPrepareParamsStack interceptor stack. If I build and run with > struts 2.0.11, it works fine - the parameter interceptor is executed before > the prepare interceptor. If I build and run with struts 2.3.15.1, the > parameter interceptor is not executed before the prepare interceptor - I get > what appears to be the default interceptor stack instead of the > paramsPrepareParamsStack, as though it is ignoring my @ParentPackage > annotation. > > I've attached two zip files with this email, one for the 2.0.11 version of > the sample app, one for the 2.3.15.1 version. For convenience, the action > class and struts.xml are shown below. (Perhaps attachments are filtered out > on this mailing list?) > > Here's the action class code: > > @Results({ > @Result(name = "success", value = "/HelloWorld.jsp")}) > @ParentPackage(value="basicstruts2") > @Namespace(value="/test") > public class HelloWorldAction extends ActionSupport implements Preparable { > > private static final long serialVersionUID = 1L; > private String someRequestParam; > private MessageStore messageStore; > public String execute() throws Exception { > //messageStore = new MessageStore() ; > return SUCCESS; > } > > public void prepare() throws Exception { > messageStore = new MessageStore(); > if(someRequestParam == null) { > messageStore.setMessage("Params not set before prepare()"); > } else { > messageStore.setMessage("Params set before prepare(), as > expected"); > } > } > > public MessageStore getMessageStore() { > return messageStore; > } > > public void setMessageStore(MessageStore messageStore) { > this.messageStore = messageStore; > } > > public String getSomeRequestParam() { > return someRequestParam; > } > > public void setSomeRequestParam(String someRequestParam) { > this.someRequestParam = someRequestParam; > } > > } > > Here's struts.xml: > > <struts> > > <include file="struts-plugin.xml"/> > > <constant name="struts.devMode" value="true" /> > > <package name="basicstruts2" extends="struts-default"> > > <interceptors> > <interceptor-stack name="myParamsPrepareStack"> > <interceptor-ref name="paramsPrepareParamsStack"/> > </interceptor-stack> > </interceptors> > > <default-interceptor-ref name="myParamsPrepareStack"/> > > </package> > > </struts> > > Thanks in advance, > Jim Greuel > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org