Initially, I deployed my Spring Boot project using the embedded Tomcat Server.
The URL was the following one: http://localhost:8080/home
.
I have finally used an external Tomcat Server and when I deployed my Spring project the final URL was the following one: http://localhost:8080/MyApp/home
.
Due to that all my resources paths are modified.
For example:
CSS (located in src/main/resources/static/css/*
)
Before : <link rel="stylesheet" href="/css/login.css">
The only solution that I found is to modify the path to :
After : <link rel="stylesheet" href="/MyApp/css/login.css">
This is not very maintainable and I would like to know if there is a better solution?