SpringMVC配置跳转html、jsp

依赖

    
      org.springframework
      spring-context-support
      ${spring.version}
    
    
      org.freemarker
      freemarker-gae
      2.3.27-incubating

配置文件

    
    
        
        
        
    
    
    
        
            /WEB-INF/pages/html/
        
    
    
        
        
        
    

配置统一跳转错误页面404.html

异常处理器
public class MyExecptionResolver implements HandlerExceptionResolver {
    public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
        ModelAndView mv=new ModelAndView();
        mv.setViewName("404");
        return mv;
    }
}

注册异常处理器
    

你可能感兴趣的:(SpringMVC配置跳转html、jsp)