STRUTS2 ACTION的扩展名默认为.action,在struts1.X前为.do,如果要把STRUTS2的ACTION 的扩展名也改成.do可以按如下方法做。
方法一
struts.xml
<struts>
<constant name="struts.action.extension" value="do" /> //注意这里
<package name="default" extends="struts-default" namespace="/example">
<action name="HelloWord" class="example.HelloWord">
<result name="SUCCESS">/example/HelloWord.jsp</result>
</action>
</package>
<!--
<include file="example.xml"/>
-->
<!-- Add packages here -->
</struts>
方法二
web.xml里也可以。
给filter加个init-param
<init-param>
<param-name>struts.action.extension</param-name>
<param-value>do</param-value>
</init-param>
Tags: struts2 ACTION 扩展名 方法
原创文章如转载,请注明:转载自:飞扬部落编程仓库 : http://www.busfly.net/csdn/
本文链接地址:http://www.busfly.net/csdn/post/STRUTS2-ACTION-do-Extension-modificion-method.html
如果你喜欢本文,请顶一下,支持我,你的支持是我继续发好文章的最大动力。谢谢。
好东西需要分享,快把本文发给你的朋友吧~!~