0

I have an Eclipse Dynamic Web application using Tomcat 9. While running, the server can 'see' all of my css and js excpet by two that I have added later.

I have already cleaned my project(s), I have already refreshed the browser pages (including ctrl+F5) and I and also tried renaming files, nothing worked. Also just tried to Clean, Stop and Publish the server again.

// tomcat can see this:
<link rel="stylesheet" href="/les2019-web/lib/css/bootstrap.min.css">

// but can't see this (error 404)
<link rel="stylesheet" href="/les2019-web/lib/css/tempusdominus.min.css">

This is the file structure: Files

Mateus Ramos
  • 190
  • 2
  • 12
  • 2
    web-inf is a special folder, in which static resources are not visible from the "browser". In order to access resources in web-inf/lib you need a special servlet to load and serve them. The easiest solution is to kust move them to "WebContent" – Svetlin Zarev Mar 18 '19 at 05:12
  • It' strange because all of the other resources can be accessed through the browser, even just typing the adress. I mean every css and js can be accessed, excpet for these two tempusdominus i've added today – Mateus Ramos Mar 18 '19 at 05:21
  • Did you redeploy the server from within Eclipse? Try stopping the server, publish, and restart. You can also clean the server itself prior to the publish. – KevinO Mar 18 '19 at 05:25
  • @KevinO Just tried, does not work also – Mateus Ramos Mar 18 '19 at 05:30
  • @SvetlinZarev Indeed moving everything outside of WEB-INF worked, thank you very much. But I still don't understand why the other files had worked even inside said folder – Mateus Ramos Mar 18 '19 at 05:35

0 Answers0