美文网首页
struts2-自定义结果类型

struts2-自定义结果类型

作者: 打死你的小乌龟 | 来源:发表于2018-01-13 23:36 被阅读0次

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>

相关文章

网友评论

      本文标题:struts2-自定义结果类型

      本文链接:https://www.haomeiwen.com/subject/jjbhoxtx.html