我在项目中添加了一个外部CSS样式表,并放在Eclipse项目的WEB-CONTENTS文件夹中.当我在Tomcat上部署它时,没有应用样式表.当我在Chrome中调试并打开它时,它给了我404 file not found错误.为什么这样以及如何解决?
这是代码:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!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>joined now </title>
<link href="globalCSS.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div>this is at the top</div>
<c:import url="header.jsp" />
<c:import url="navigationBar.jsp" />
<c:import url="leftpane.jsp" />
<c:import url="mainContent.jsp" />
<c:import url="rightpane.jsp" />
<c:import url="footer.jsp" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)