Strange URL after "redirect:/" (@ModelAttribute values are attached)
Hello.
Here is some code below which is used in my application (only important snippets, actual names are changed):
Quote:
@Controller
MyController {
...
// PhoneCategory is Enum
@ModelAttribute("phoneCategories")
public List<PhoneCategory> populatePhoneCategories() {
return Arrays.asList(PhoneCategory.Home, PhoneCategory.Mobile);
}
...
@RequestMapping(value = "/profiles/account", method = RequestMethod.GET)
public AccountProfileForm accountProfileForm() {
return new AccountProfileForm();
}
...
@RequestMapping(value = "/profiles/account", method = RequestMethod.POST)
public String accountProfileForm(Account account, @Valid AccountProfileForm accountProfileForm, BindingResult formBinding, final WebRequest request) {
...
return "redirect:/";
}
And after the POST request, I get the following URL:
localhost:8080/appl/?phoneCategories=Home&phoneCategories=Mobile
Why phoneCategories is attached into my URL?
This param is missed for GET, and I don't have any issues with others controllers in my application. Is it for the case I use List<Enum> for @ModelAttribute?