Reputation: 309
How to link a css file into a jsp file. My jsp file is in /WEB-INF/Pages/connection.jsp My css file is in /WEB-INf/Pages/style.css
.
Upvotes: 1
Views: 144
Reputation: 48287
Don't put public+static resources in WEB-INF
(WEB-INF is for protected resources, like JSPs)
Put public resources in webapp/static
(pages is not a good names for things that aren't pages)
Use JSTL core url tag for URLs:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<link rel="stylesheet" href="<c:url value='/static/styles/style.css'/>">
Upvotes: 2
Reputation: 977
Your CSS and JS (any client side resources CANNOT reside in the WEB-INF folder as it is not visible outside - it can only be accessed from the server.
Upvotes: 1
Reputation: 337
In jsp file use that tag inside the header tag,
<link rel="stylesheet" type="text/css" href="Pages/Style.css">
Upvotes: 2