Home > other >  Passing an parameter from controller to view
Passing an parameter from controller to view

Time:04-08

I was making a spring mvc project, when I tried to pass an url param from the controller to the view. I tried to do with with return "/passChange?error=true";. That does not work tho and I am out of ideas. Any suggestions?

CodePudding user response:

Use

model.addAttribute("error");

CodePudding user response:

Use redirect instead.

return "redirect:/passChange?error=true"

See this

  • Related