日期:2014-05-20  浏览次数:20919 次

404报错。。。求解决。。。
index.jsp已经放在webroot文件夹下了。。附上我的index.jsp的代码...和web.xml代码。。。不知道为什么一直报404错误。。。郁闷的很啊。。。

consolo的报错信息是:严重: Parse error in application web.xml file at jndi:/localhost/waimaiwang/WEB-INF/web.xml

index.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>


------解决方案--------------------
XML code
    <!--
        ===============================================================
    -->
    <!--
        配置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>