I have the following file structure for my Dynamic Web Project
src
+---main
| +---java
| +---all the java files under proper packages
+---resources
| +---css
| +---index.css
+---webapp
+---WEB-INF
| +---web.xml
+---index.html
Now, I have specified index.html
as the welcome file in web.xml
. But when I'm specifying link to CSS file index.css
in index.html
, it's not able to find the file.
I'm referring to the CSS file in the following way
<link rel="stylesheet" type="text/css" href="css/index.css">
Checkout this image for the structure of all the web files that are deployed in web browser.
Edit: I also have tried referring to CSS file like this
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/index.css">
But still not working.
Note : I haven't used anything related to spring yet. It's just a simple Web application with a html and css file.