Eclipse,Tomcat - 请求的资源不可用 JSP

Eclipse , Tomcat - The requested resource is not available JSP

为什么不能 运行 在服务器上 jsp 文件放入 webapp/WEB-INF/index.jsp(Tomcat 显示错误 404 - 请求的资源是不可用)但我可以从 webapp/index.jsp 文件夹中 运行 jsp 文件?

更新

web.xml

<?xml version="1.0" encoding="UTF-8"?> 
<web-app 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_3_0.xsd"
          version="3.0">
<display-name>J2EE Applications Example</display-name>

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

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>
Test
</body>
</html>

因为根据设计,WEB-INF 是无法从外部访问的应用程序的唯一 文件夹。

这很正常:这是您存储 webapp 的全部代码、其配置等的地方。

您真的不希望任何人能够在地址栏中键入 /WEB-INF/lib/app.jar 并下载您的网络应用程序的 类。