“<constant name="struts.action.extension" value="html" />”
就可将struts的请求URL后缀后改成*.html,而不是*.action
也就是说http://127.0.0.1:7001/SSH/newUserInfoAction.action
同等于http://127.0.0.1:7001/SSHNEW/newUserInfoAction.html
如不增加此节点。struts的请求URL后缀名默认为action。
其value的值可是为多个(以豆号分开),此时请求相同地址时value中的后缀名都有效。
如下设置
<constant name="struts.action.extension" value="action,jsp,html" />
Struts.xml配置文件:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
......
<constant name="struts.action.extension" value="html" />
</struts>