0

this is my very first Java webapp and I'm trying to integrate a template bootstrap(https://github.com/colorlibhq/AdminLTE) as my front end.

I'm getting the 404 error, GET http://localhost:8080/style.css net::ERR_ABORTED 404 and i cant seem load all the files needed for my index.jsp file

This is my project structure: Project Structure

I cannot seem to find the right URL to access the files.They plugins for example are located inside Webcontent > assets > admin > plugins

I tried using ${pageContext.request.contextPath} but it hasn't worked

<link rel="stylesheet" href="${pageContext.request.contextPath }/WebContent/assets/admin/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">

I honestly dk what is going on and can i also ask the difference between Java resources and Web Content? I would really appreciate it if you were to share resources with me on developing web applications using java, so far.

Martin Frank
  • 3,445
  • 1
  • 27
  • 47
jffryteo
  • 31
  • 4
  • Hi everyone, i see similar issues but they are abit dated, if my explanation sucked, perhaps these might help. please help! https://stackoverflow.com/questions/20129121/cant-access-css-and-javascript-files-in-jsp https://stackoverflow.com/questions/3655316/browser-cant-access-find-relative-resources-like-css-images-and-links-when-cal – jffryteo Jan 09 '20 at 09:49

1 Answers1

-1

YOu have to give relative path of your css file

<link rel="stylesheet" href="./WebContent/assets/admin/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
Amit Rai
  • 289
  • 1
  • 4
  • 22
  • 1
    it didn't work too :( it gave me the same result as when i used " ${pageContext.request.contextPath} " – jffryteo Jan 09 '20 at 07:34
  • you should inspect you browser and check what file path you getting in network tab – Amit Rai Jan 09 '20 at 08:52
  • basically all my js and css files are unable to be found :/ must be smth to do with the path but i cant figure it out – jffryteo Jan 09 '20 at 09:03