index.jsp已经放在webroot文件夹下了。。附上我的index.jsp的代码...和web.xml代码不知道为什么一直报404错误郁闷的很啊consolo的报错信息是:严重: Parse error in application web.xml file at jndi:/localhost/waimaiwang/WEB-INF/web.xmlindex.jsp:
<%@page contentType="text/html;charset=gb2312" %>
<%@taglib prefix="s" uri="/struts-tags" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'index.jsp' starting page</title>
<link rel="stylesheet" type="text/css" href="css/store.css"/>
  </head>
  
  <body>
    <jsp:include page="head.jsp"></jsp:include>
    <div class=content>
    <div class=left>
        <div class=list_box>
        <div class=list_bk>
              <s:action name="browseCatalog" executeResult="true"/>
              </div>
            </div>
          </div>
          <div class=right>
             <div class=right_box>
                   <font face=宋体></font><font face=宋体></font><font face=宋体></font><font face=宋体></font>
                   <div class=banner></div>
                   <div align="center">
                         <s:action name="newBook" executeResult="true" /></div>
                   </div>
                   </div>
                  </div>
         <jsp:include page="foot.jsp"></jsp:include>
  </body>
</html>
web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
       <filter-name>struts2</filter-name>
       <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
       <filter-name>struts2</filter-name>
       <url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
             <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern></filter-mapping></web-app>

解决方案 »

  1.   

    你的Web.xml中配置两个
    <filter-name>struts2</filter-name>是想干什么?
      

  2.   

    你把FilterDispatcher去掉,留ContextLoaderListener这个,二者用一个就行,推荐用ContextLoaderListener。
      

  3.   

    <!--
    ===============================================================
    -->
    <!--
    配置spring监听器
    -->
    <!-- =============================================================== -->
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener> <!-- =============================================================== -->
    <!--
    struts2过滤器的配置
    -->
    <!-- =============================================================== -->
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
      

  4.   


    struts2的配置重复了,去掉一个就好了
    照这个配就没问题了
      

  5.   

    struts2的配置过滤器重复了,5楼感觉很不错!