我的控制器中有这样的映射:
@RequestMapping(value = "events/newEvent", method = RequestMethod.POST)
public ModelAndView getOrganizerForNewEvent(@RequestParam("id") int organizerId){
OrganizerEntity organizerEntity = organizerDAOService.findById(organizerId);
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("/newEvent");
modelAndView.addObject("organizer", organizerEntity);
return modelAndView;
}
webapp ::
中的这种结构开发工具请求看起来正确:
我做错了什么?
答案 0 :(得分:1)
我认为您有错误,因为视图名称不正确
modelAndView.setViewName("/newEvent");
您应该使用不带斜线的名称:
modelAndView.setViewName("newEvent");