Struts 2 Action 的扩展名修改方法
2008-11-10 22:29
218 查看
本人从生理上反感Struts 2,看着洋洋洒洒几百行的抛错信息就郁闷
Struts 2 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>
Struts 2 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>
相关文章推荐
- Struts2 action的扩展名两种修改方法
- STRUTS2 ACTION的扩展名修改方法
- Struts2 action的扩展名修改方法
- struts中action的修改方法
- Struts2 action的扩展名修改方法
- Struts2 action的扩展名两种修改方法
- Struts2 action的扩展名两种修改方法
- Struts2 action的扩展名两种修改方法
- Struts2 Action扩展名的三种修改方法
- spring+struts结合在第一次验证失败之后,不再走action的方法,直接进入input
- Struts action 多个方法
- Struts.xml中Action的method与路径的三种匹配方法
- 关于eclipse+struts action找不到问题解决方法 There is no Action mapped for namespace
- 关于struts如何在action中实现多个处理方法
- struts做开发的时候action是继承Action方法还是ActionSupport方法
- struts1 从action跳转到另一个action的方法
- 【Struts框架】第一节Action-struts访问request等引用方法二
- Struts的action自动装配到spring容器可能出现异常的解决方法
- StrutsAction中传入的form对象为空的解决方法
- Struts2一个Action内包含多个请求处理方法的处理,method的使用方法,struts2中的路径问题,通配符映射