1、编写一个类,实现com.opensymphony.xwork2.Result接口。
2、声明自定义的结果类型:先声明后使用
<struts>
<constant name="struts.devMode" value="true"></constant>
<package name="pp" extends="struts-default">
<result-types><!--声明-->
<result-type name="ss" class="com.xxx.xxx"></result-type>
</result-types>
</package>
</struts>
3.使用
<action name="cc" class="com.hw.action.Hello" method="say">
<result name="hah" type="ss">/Page.jsp</result><!--引用-->
</action>
网友评论