【问题标题】:Is there a way to change Struts 2 extension through web.xml without using struts configuration?有没有办法通过 web.xml 更改 Struts 2 扩展而不使用 struts 配置?
【发布时间】:2019-01-04 10:30:14
【问题描述】:

struts.xml中有一个常量可以定义

  <constant name="struts.action.extension" value="htm"/>

但我想尽量减少配置文件的使用。

【问题讨论】:

    标签: jakarta-ee struts2 struts web.xml


    【解决方案1】:

    我找到了这个解决方案:

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
        </filter-class>
        <init-param>
            <param-name>struts.action.extension</param-name>
            <param-value>htm</param-value>
        </init-param>       
    </filter>
    

    【讨论】:

      猜你喜欢
      • 2017-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-19
      • 2012-10-03
      • 2013-05-13
      相关资源
      最近更新 更多