Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

362
Vistas
How to make tomcat server deliver javascript/css from spring boot application on first page load?

I have a small Spring Boot Web Application which is running on a tomcat server. It consists only of a single html page. This page loads some css files in the head-section and two js files at the end of the body.

When I load the page in Chrome (same situation in Firefox etc.) with an empty browser cache the html get loaded correctly but the css/js files get a 404 (see first picture). The result is that the page is completly unstyled and without any functions. When I then hit F5 the page loads completly and looks and works as expected (see picture 2). This behaviour is reproducible! If I ever again load the page without deleting the jsessionid-cookie the page always loads everything.

CSS/JS is not loaded

Page loads completly

The problem seems to be that there is no jsessionid-cookie present in the very first load of the html page. The HTTP-Response to that very first HTTP-request delivers a jsessionid-cookie which the other HTTP-request use (as you can see in the first picture). But the session seems not to be recognized in the servlet.

Every page load later on has a cookie present in the first HTTP-request. Even if the jsessionid-cookie is invalid the page loads completly.

I does not matter if the connection is to localhost or a remote-server, if it's HTTP or HTTPS, if it's HTTP 1.1 or HTTP 2.

Does someone know if this is a configuration problem? Or something special to spring-boot or tomcat?

Ideas appreciated.

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda