I read many different ways to incorporate CSS into a Spring MVC project, and they all load fine when deployed to a server:
<link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet"> <link href="<c:url value='/css/style.css' />" rel="stylesheet"> <link href="/MyApp/css/style.css" rel="stylesheet">
However, it seems that Eclipse is not too happy if I did not provide a relative path (for example ../../css/style.css ../ ../../css/style.css ), but this path will obviously not load during deployment. If I use one of the three methods above, I get a red wavy line below the path with the error:
Undefined CSS file ("${pageContext.request.contextPath}/css/style.css").
All classes used from this stylesheet will also have a similar error:
Undefined CSS class (class-name).
Am I missing something or do I need to live with it and turn off warnings?
spring eclipse css spring-mvc
tys
source share