(1)struts.devMode 开发模式
在struts.xml文件中加入<constant name="struts.devMode" value="true" />
开发模式下使用,默认为false,设置成true,这样可以打印出更详细的错误信息,有助于查找到错误。 不用每次更改action的name属性都要重新部署,提高开发效率。在开发的时候建议开启,项目发布之后改成false
(2)namespace 命名空间
若<package name="default" extends="struts-default" namespace="/">
则http://localhost:8888/struts2_s_demo/index.jsp
若<package name="default" extends="struts-default" namespace="/test">
则http://localhost:8888/struts2_s_demo/test/index.jsp