0

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.

amit_vickey
  • 45
  • 1
  • 9
  • Did you try putting the css file in `webapp/css` folder? – iPirat Aug 23 '18 at 05:25
  • Possible duplicate of [Where do CSS and JavaScript files go in a Maven web app project?](https://stackoverflow.com/questions/7836930/where-do-css-and-javascript-files-go-in-a-maven-web-app-project) – Himanshu Bhardwaj Aug 23 '18 at 05:28

0 Answers0