struts2是可以配置默认的后缀名的,如http://localhost:8080/test.action,这个是默认的,但是也可以通过配置去修改这个.action为别的。
这里是通过一个常量配置改变的。
<constant name="struts.action.extension" value="do"/>
这样的就会变为http://localhost:8080/test.do来访问。
但是我很不喜欢有后缀,百度了很多大家的结论一般都是使用SmartUrls和urlrewritefilter这两个解决,但是我只是想把后缀去掉而已,就让我增加别的组件这个实在很不爽,最后终于找到了个方法:
<constant name="struts.action.extension" value=","/>
在这里把value配置为,就可以使用http://localhost:8080/test完成访问了
把这段注释加上吧,大家可以看看
### Used by the DefaultActionMapper ### You may provide a comma separated list, e.g. struts.action.extension=action,jnlp,do ### The blank extension allows you to match directory listings as well as pure action names ### without interfering with static resources, which can be specified as an empty string ### prior to a comma e.g. struts.action.extension=, or struts.action.extension=x,y,z,, struts.action.extension=action,,
发表自本人博客 http://irfen.me
相关推荐
java struts如何隐藏提交后缀.action, .do
struts2-core-2.0.1.jar, struts2-core-2.0.11.1.jar, struts2-core-2.0.11.2.jar, struts2-core-2.0.11.jar, struts2-core-2.0.12.jar, struts2-core-2.0.14.jar, struts2-core-2.0.5.jar, struts2-core-2.0.6.jar,...
Struts2升级到2.5.30,问题解决及过程记录, 文章详见:https://blog.csdn.net/sinat_36743893/article/details/124582101
org.springframework.web.struts-3.1.0.M2.jar
struts-taglib-1.3.8.jar struts-taglib-1.3.8.jar
Manning.Struts.2.in.Action.May.2008
struts2--2.Action
用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的'do'字。 struts.configuration The org.apache.struts2.config.Configuration implementation class org....
Struts2--3.Action及相关-1
struts-2.3.34-all.rar,包括app,docs,lib,src
Struts2--3.Action及相关-2
Namespace、自定义Action、路径问题、通配符、包含模块配置文件、默认Action、接受用户输入、服务器跳转、Action中访问web元素、简单数据校验、调用Action的自定义方法 5struts2国际化 ......... 6 struts2输入校验...
struts1.38包,struts-core-1.3.8.jarstruts1.38包,struts-core-1.3.8.jar
MyEclipse 6 Java 开发中文教程2011.pdfMyEclipse 6 Java 开发中文...开发Struts 2+Spring应用.pdf第十二章 开发Struts 2+Spring应用.pdf第十二章 开发Struts 2+Spring应用.pdf第十二章 开发Struts 2+Spring应用.pdf
struts2的token实现.
绝对可以解决这个这个问题。Struts初学者绝对可以受用的方法。
Struts2文件批量上传.zip Struts2文件批量上传.zip Struts2文件批量上传.zip Struts2文件批量上传.zip Struts2文件批量上传.zip
Struts2漏洞检查工具Struts2.2019.V2.3
2017年7月7日,Apache Struts发布最新的安全公告,Apache Struts2-strus1-plugin插件存在远程代码执行的高危漏洞,漏洞编号为CVE-2017-9791(S2-048),主要受影响的Struts版本为:2.3.x。 攻击者可以构造恶意的字段值...
import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;import org.apache.struts.actions.DispatchAction等缺少