I am using spring security in my application.
In one of my controller method I am redirecting to another controller method and attaching model Attributes but I am not getting those modelAttributes in next controller method.
Is it happening because of some internal redirection from Spring Security Filter which might be killing those redirect flash attributes?
This is my code :
@RequestMapping("/method1")
public String firstMethod(Model model,RedirectAttributes redirectAttributes) {
... do something ...
redirectAttributes.addFlashAttributes("message","This is a test message");
return "redirect:/method2";
}
@RequestMapping("/method2")
public String secondMethod(@ModelAttribute("message") String message, Model model) {
... do something ...
return "some_view";
}
Here in secondMethod message is coming as blank( "" );