SpringMVC Controller返回值类型记录
在SpringMVC中的Controller
想要重写向到某一页可以使用ModelAndView
public ModelAndView saveAudioReplyMethod(ModelMap map,HttpServletRequest request,AudioReply reply,String audioId)
{
User user=userService.findUserById("1");
Audio audio =audioService.findAudio(audioId);
replyService.saveAudioReply(reply,audio,user);
return new ModelAndView("redirect:"+request.getHeader("Referer"));
}
如果不加redirect:就是转发