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

469
Views
How to refresh a html page without using a html form? Tried redirect: it does not work

I need to delete a question. By using following endpoint I can delete a question without any issue. But I need to refresh the forum.html page after deleting the question. I used "redirect:/forum.html" but it does not work.How can I refresh the forum.html

@Controller
public class ForumController {

 @PostMapping("/deleteQuestion")
    public String deleteQuestion(@RequestParam Long questionId){


        questionRepository.deleteById(questionId);


        return "redirect:/forum.html";
    }
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can use javascript native function to reload your page:

window.location.reload(true)

You can use this function when your deleting request is completed as a callback.

about 4 years ago · Juan Pablo Isaza Report

0

use jquery function for reload

location.reload(true);

or

location.replace(location.pathname);
about 4 years ago · Juan Pablo Isaza Report
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!