Skip to content

Commit 0d4e00b

Browse files
committed
Add @ModelAttribute to ajaxRequest argument.
1 parent b1c4b3d commit 0d4e00b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/springframework/samples/mvc/form/FormController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ public void form() {
3838
}
3939

4040
@RequestMapping(method=RequestMethod.POST)
41-
public String processSubmit(@Valid FormBean formBean, BindingResult result, boolean ajaxRequest,
42-
Model model, RedirectAttributes redirectAttrs) {
41+
public String processSubmit(@Valid FormBean formBean, BindingResult result,
42+
@ModelAttribute("ajaxRequest") boolean ajaxRequest,
43+
Model model, RedirectAttributes redirectAttrs) {
4344
if (result.hasErrors()) {
4445
return null;
4546
}

0 commit comments

Comments
 (0)