When refreshing the jsp page then I have an error that argument type miss match

61 Views Asked by At

I can using to request mapping with the value "home"

@RequestMapping(value = "home", method = RequestMethod.POST)
public String showHomePage(
       @ModelAttribute("loginForm") LoginBean object,
       ModelMap model, 
       BindingResult result) { 
model.addAttribute("name", name);
return "home";
}

and

@RequestMapping(value = "home", method = RequestMethod.GET)
public String showHomePage1(
       @ModelAttribute("loginForm") LoginBean object,
       ModelMap model, 
       BindingResult result) {
model.addAttribute("name", name);
return "home";
}

but when I refresh page it will generate an error that argument type miss match

1

There are 1 best solutions below

0
On

When you refresh the page, it calls the same Get method. So maybe the first time you open this page directly, because if not, it should throw an error the first time.

And I think there's either something wrong with your page, or with your name Entity. Can you post your page code and Entity class please?