我是通过在struts.xml文件中加constants的。
但是一加上就报错。很莫名啊!!

解决方案 »

  1.   

    在struts.xml中加入:
    <constant name="struts.action.extension" value="do" />在web.xml文件更改:
    <url-pattern>*.do</url-pattern>然后submit的时候就报错404了。茫然!
      

  2.   

    1.
    http://localhost:8080/xxx/login使用struts2默认后缀名,struts2默认配置struts.action.extension=action,,。
    即action或者不写。
    http://localhost:8080/xxx/login

    http://localhost:8080/xxx/login.action都能正常访问。2.
    struts.action.extension=do是你自定义后缀名必须加do
    即:http://localhost:8080/xxx/login.do