Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

294
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda