【问题标题】:Error : HTTP Status 500 - An exception occurred processing JSP page错误:HTTP 状态 500 - 处理 JSP 页面时发生异常
【发布时间】:2016-07-08 15:08:43
【问题描述】:

添加上下文文件后,我收到此错误:Statut 404 .. 我的网络文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="WebApp_ID" version="3.0">
    <display-name>CRUDWebAppMavenized</display-name>

    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>classpath:log4j.xml</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>

structure

我不知道问题到底出在哪里! 'student.jsp' 页面位于 wepapp 文件夹内。

【问题讨论】:

  • 谷歌如何读取堆栈跟踪。至少谷歌什么是堆栈跟踪,这样你就知道在哪里寻找问题。也不要附图片,把相关代码贴在这里,以及所有相关的错误信息
  • 有时我会收到这个错误:HTTP Status 404 - Why ??
  • 因为找不到东西

标签: java spring hibernate jsp


【解决方案1】:

将此添加到您的 web.xml:

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

您可能缺少 ContextLoadListener,它会拾取您的 Spring 配置文件。如果这不能解决您的问题,请编辑您的问题以包含您的 web.xml 文件的内容。

【讨论】:

  • 完成!之后我收到 404 错误消息。
  • 那是因为您的应用程序无法找到您要查找的网页。您的应用程序中没有它,或者它设置不正确。发布您的文件结构的图片,以及您尝试访问的链接,也许我可以提供帮助。
  • 我添加了结构图!请检查!
猜你喜欢
  • 2014-04-22
  • 2013-10-07
  • 2014-07-29
  • 1970-01-01
  • 2013-08-26
相关资源
最近更新 更多