Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

293
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!