Struts2 如何在不使用struts.xml中的常量的情况下从URL中删除.action
我正在使用Struts 2约定插件。我不想在我的应用程序中使用任何基于XML的配置。那么,在这种情况下,如何在不使用Struts2 如何在不使用struts.xml中的常量的情况下从URL中删除.action,struts2,xml-configuration,struts2-convention-plugin,deployment-descriptor,Struts2,Xml Configuration,Struts2 Convention Plugin,Deployment Descriptor,我正在使用Struts 2约定插件。我不想在我的应用程序中使用任何基于XML的配置。那么,在这种情况下,如何在不使用struts.xml中的的情况下从URL中删除.action扩展名呢?我目前正在使用struts.xml文件来删除.action扩展名。是否有任何批注要删除.action扩展名 没有这样的注释。您可以使用struts.properties或在web.xml中定义一个常量,如 <filter> <filter-name>struts2</filt
struts.xml
中的
的情况下从URL中删除.action
扩展名呢?我目前正在使用struts.xml
文件来删除.action
扩展名。是否有任何批注要删除.action
扩展名 没有这样的注释。您可以使用struts.properties
或在web.xml
中定义一个常量,如
<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>,</param-value>
</init-param>
</filter>
支柱2
org.apache.struts2.dispatcher.ng.filter.strutspreadexecutefilter
struts.action.extension
,
默认设置已允许使用空操作后缀;具体地看,struts.action.extension=action,
允许.action
与空扩展一起使用真的很麻烦吗?