如果我在地址栏输入localhost:8080/sturts/login.jsp就不会报以上错误和警告:could not find action or results,然而我想在地址栏输入输入localhost:8080/sturts/就转到列表那里,就是列出根目录下的所有文件而且不会报错,我的Tomcat已经设置了       
 <init-param>
            <param-name>listings</param-name>
            <param-value>true</param-value>
  </init-param> 
我没有在项目中的web.xml写
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
这个在Tomcat中已经有了
并且我项目中的根目录下没有index文件就是以上的三个文件其中一个
在线等答案

解决方案 »

  1.   

    是修改的这个文件吗tomcat\conf\web.xml ,把listings值变成true
      

  2.   

    这个错误表示你没配置相应的ACTION,在struts.xml里
      

  3.   

    如果我把 <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>去掉就又可以显示目录,可是跳转到upload.jsp又报错
    The server encountered an internal error () that prevented it from fulfilling this request.这证明是Struts过滤器遍历了一遍根目录下的action,请问有没有什么方法可以解决
      

  4.   

    请仔细看楼上回答。太明显的错误。已经指出你的namespace不存在
      

  5.   

    localhost:8080/sturts/login.jsp我这样就可以访问login这个页面而且是0 error 0 warning
    我在Tomcat中的server.xml是这样写的<Context path="/struts" docBase="D:\workspace\Struts2.2\WebRoot" reloadable="true" />
    请再仔细看下我问题,谢谢
      

  6.   

    准确点表达是:使用Struts2.2.1后无法显示WebRoot根目录的文件