@RequestMapping(value = { "postCustomer" }, consumes = "application/json", method = {RequestMethod.POST})
public ModelAndView postHome(@RequestBody JSONObject body, Model model) throws JSONException {
ModelAndView mav = new ModelAndView("redirect:/feasibility");
return mav;
}
@GetMapping(value = { "feasibility" }) // GET MAPPING
public String feasibility(ModelAndView model) throws Exception {
return "feas";
}
I am trying to forward/redirect the user to a new JSP file, I can go to <url>/feasibility
and it updates, but when I POST postCustomer
it doesn't redirect or update the view. I've also tried creating a ModelAndView
with the JSP "feas" and just returning that within postCustomer
but that doesn't work either. I'm not sure if I am missing something obvious, or if I have to do an additional step to update the view.
If anyone has any suggestions or solutions, I'd appreciate it.