I would like to redirect the user to "/" page.
In my controller, I have:
@RequestMapping(value = "/uploadImage", method = {RequestMethod.POST})
public ModelAndView addUser (@RequestParam(value="file") MultipartFile file,
HttpServletRequest request,
ModelMap model) {
...
if (...) {
model.addAttribute("uploadFileError", true);
return new ModelAndView("/", model);
}
return new ModelAndView("/", model);
and in my receiving page:
@RequestMapping(value = "/")
public String root(Model model, HttpServletRequest request) {
...
return "index";
}
but Spring returns "Error resolving template [/], template might not exist or might not be accessible by any of the configured Template Resolvers"
Please help. Thanks.