Java 错误:HTTP状态500-处理JSP页面时发生异常
在添加上下文文件后,我得到这个错误:Statut 404。。 我的web文件:Java 错误:HTTP状态500-处理JSP页面时发生异常,java,spring,hibernate,jsp,Java,Spring,Hibernate,Jsp,在添加上下文文件后,我得到这个错误:Statut 404。。 我的web文件: <?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_
<?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>
我不知道问题到底出在哪里!“student.jsp”页面位于wepapp文件夹内。将其添加到web.xml中:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
您可能缺少获取Spring配置文件的ContextLoadListener。如果这不能解决您的问题,请编辑您的问题以包含web.xml文件的内容。Google how to read a stack trace。至少用谷歌搜索一下堆栈跟踪是什么,这样你就知道在哪里可以找到问题了。也不要附加图像,在这里发布相关代码和所有相关错误消息,有时我会收到这个错误:HTTP状态404-为什么?因为有些事情没有完成!这样做之后,我得到404错误消息。这是因为你的应用程序无法找到你正在寻找的网页。您的应用程序中没有它,或者它的设置不正确。发布你的文件结构图片,以及你试图访问的链接,也许我能帮上忙。我已经添加了结构图片!请检查!