I am using Spring boot starter web, and I am trying to link my stylesheet style.css in my JSP. How can I use the default configuration to link my css correctly ?
The following line in the <head></head>
isn't working:
>page.jsp:
<link href="css/style.css" rel="stylesheet" ></link>
Location of the files:
- style.css : /src/main/resources/static/css/style.css
- page.jsp : /src/main/webapp/WEB-INF/jsp/page.jsp
Note :I can access my CSS using this address http://localhost:8080/css/style.css
On the other hand, using a JSTL tag works :
>page.jsp:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:url value="/css/style.css" var="jstlCss" />
<link href="${jstlCss}" rel="stylesheet" >
Could someone explain me the reason?