On 04/25/2014 10:56 AM, Lukasz Lenart wrote:
You can create one abstract package and all other packages can inherit
from it - the same as you inherit from "tiles-default"
So, another way to do the change would be:
<package name="top" extends="tiles-default">
..... //Coding for [1]
</package>
<package name="p1" namespace="/n1" extends="top">
......
<package name="pN" namespace="/nN" extends="top">
Is it correct?
This is the preferred approach
Or, if I keep "extends=tiles-default", by adding "interceptors(coding for
[1])" to p1...pN as shown below will do the job, right?
Yes, but package inheriting was designed to avoid such situations -
you can also inherit from many packages eg. extends="top,
tiles-default"
http://struts.apache.org/release/2.3.x/docs/package-configuration.html#PackageConfiguration-Inheritfrommorethanonepackage
Got it and make the changes below ( I do not use struts-default, so
extends tiles-default):
<package name="top" extends="tiles-default" abstract="true">
<interceptors>
<interceptor-stack name="secureDefaultStack">
<interceptor-ref name="defaultStack">
<param
name="params.excludeParams">(.*\.|^|.*|\[('|"))(c|C)lass(\.|('|")]|\[).*,^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="secureDefaultStack" />
</package>
Reason do two: when new libs are ready, will just remove top and keep
tiles-default.
<package name="p1" namespace="/n1" extends="tiles-default,top">
......
<package name="pN" namespace="/nN" extends="tiles-default,top">
If there were anything should be updated, please let me know. Otherwise,
I will adopt this approach and deploy to all config files.
Thank you very much!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org