java – HTTP状态 – 404 JSP中没有找到资源异常
发布时间:2020-12-15 05:11:30 所属栏目:Java 来源:网络整理
导读:参见英文答案 JSP in /WEB-INF returns “HTTP Status 404 The requested resource is not available”????????????????????????????????????2个 我一直坚持在JSP中运行hello world程序.当我启动我的服务器时,它显示资源未找到异常.请帮我解决这个问题.我在
参见英文答案 >
JSP in /WEB-INF returns “HTTP Status 404 The requested resource is not available”????????????????????????????????????2个
我一直坚持在JSP中运行hello world程序.当我启动我的服务器时,它显示资源未找到异常.请帮我解决这个问题.我在下面提到了我的代码 的index.jsp: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> </body> </html> web.xml中 <?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" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>MySample</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> 解决方法
从
comments above开始,您将文件放在错误的文件夹中.
将index.jsp文件放在WebContent文件夹中.不要放入WEB-INF文件夹. WebContent文件夹
参考 > Dynamic Web projects and applications directory structure in Eclipse IDE (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |