hbl
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>

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2021-06-14
  • 2022-01-28
  • 2021-11-16
  • 2022-12-23
猜你喜欢
  • 2021-07-19
  • 2022-12-23
  • 2021-10-15
  • 2021-09-07
  • 2022-01-25
  • 2021-11-11
  • 2022-12-23
相关资源
相似解决方案