【发布时间】:2011-09-14 16:50:16
【问题描述】:
我需要找到一种方法来捕获异常并将它们抛出到 jsp 页面
public class someController
{
@ExceptionHandler(Exception.class)
@ResponseBody
public void handleException(Exception exception,HttpServletRequest request, HttpServletResponse response)
{
//how do I use this function to get exceptions and send them to
//testModelView url below
}
@GET
@Path("/testModelAndView")
public ModelAndView resolveException()
{
ModelAndView mav = null;
mav = new ModelAndView("/view.jsp");
mav.addObject("/support/500.jsp", "Blah");
return mav;
}
【问题讨论】: