Closed GoogleCodeExporter closed 8 years ago
In your struts xml file, you can setup multiple interceptors to be used for your
action (i.e., paramsPrepareParamsStack and json in my example below). If you are
doing this for several actions, you may want to specify a package in your
struts xml
file that all your "smd" actions use. There, you can specify a "default"
interceptor
stack that calls all the interceptors you want. Then, all your "smd" actions
can just
use the defaults.
Example of package which defines defaults for my actions using smd.
<package name="jsonSmd" namespace="" extends="json-default">
<result-types>
<!-- override this "json" result-type from json plugin with custom
settings/defaults -->
<result-type name="json" class="com.googlecode.jsonplugin.JSONResult"
default="true" >
<param name="enableSMD">true</param>
<param name="enableGZIP">true</param>
</result-type>
</result-types>
<interceptors>
<interceptor-stack name="jsonSmdStack">
<interceptor-ref name="paramsPrepareParamsStack"></interceptor-ref>
<interceptor-ref name="json">
<param name="enableSMD">true</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="jsonSmdStack"/>
</package>
<package name="myTestPackage" namespace="/test" extends="jsonSmd">
<action name="testSMD" class="com.test.TestSMDAction" method="smd">
<result name="success" />
</action>
</package>
Original comment by bsennin...@gmail.com
on 7 Jan 2009 at 8:39
very well explained by bsenninger@, thanks!
Original comment by musa...@gmail.com
on 28 Jul 2009 at 5:10
Original issue reported on code.google.com by
rajibj...@gmail.com
on 6 Jan 2009 at 6:56