在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:就是转发

相关文章:

  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2021-07-01
  • 2021-07-30
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-05
  • 2022-12-23
  • 2021-09-21
  • 2021-07-30
相关资源
相似解决方案