Adding "model.asMap().clear();" will prevent the attribute name-value pair from appearing in the URL.
The attribute name-value pair will be included in the URL, regardless of the use of @ModelAttribute in the controller.
The attribute name-value pair cannot be excluded from being displayed in the URL.
Given the method below:
@RequestMapping(value = "/foo", method = RequestMethod.GET)
public final String foo(HttpServletRequest request, BindingResult bindResult, ModelMap model) {
model.addAttribute("abc", 123);
return "foo";
}
When the view is displayed in the browser, it's URL is "http://mydomain/foo?abc=123".
Which of the following statements is true?
Correct Answer:
The attribute name-value pair will be included in the URL, regardless of the use of @ModelAttribute in the controller.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Spring MVC MCQ Questions