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

295
Vistas
How to Remove Spinner on Thymeleaf and Spring-Boot Form When Browser Stop Load Pressed

I have a spring-boot/thymeleaf application that submits a query to a Webclient service. While the webclient performing the get request, I display a spinner on the form page. After the results are retrieved the application redirects to the template in the @PostMapping method, displays the results, and since it's a new page no more spinner. Works as desired.

But, if the user stops the page load while the webclient is performing the get request the spinner remains since no EventListener is registered with the stop load to hide the spinner. So I was wondering:

  1. What DOM/Window event is trigger when the stop load page is pressed? I tried document.onabort, document.oncancel, window.onabort, window.oncancel, window.onunload, etc. and nothing. I added document and window click event listeners below (as well as abort, cancel) and confirmed that nothing gets logged when stop load is pressed.

  2. And for future debugging/testing, is there a console.log debugging code I use to "follow" the navigation click similar to this:

    document.addEventListener("click", (event) => {
        console.log(event)
    })
    
    window.addEventListener("click", (event) => {
        console.log(event)
    }) 

Am I out of luck trying to do this with javascript? Is there a pure Spring/Thymeleaf alternative for this logic?

about 4 years ago · Juan Pablo Isaza
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