package cn.basttg.core.exception;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
public class MyExceptionHandler implements HandlerExceptionResolver {
	public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
			Exception ex) {
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("ex", ex);
		
		// 根据不同错误转向不同页面
		if(ex instanceof BusinessException) {
			return new ModelAndView("error-business", model);
		}else if(ex instanceof ParameterException) {
			return new ModelAndView("error-parameter", model);
		} else {
			return new ModelAndView("error", model);
		}
	}
}
最近下载更多
                
                13940562934     LV22
                2019年11月14日
            
            
        
                jinzhang     LV10
                2018年7月8日
            
            
        
                m719067455     LV20
                2018年4月24日
            
            
        
                alin007     LV5
                2018年1月23日
            
            
        
                gezhiling     LV15
                2017年7月20日
            
            
        
                ponygao     LV14
                2017年7月16日
            
            
        
                fanfanfeng     LV1
                2017年3月13日
            
            
        
                stone_tiantian     LV2
                2017年1月4日
            
            
        
                zgdkik     LV1
                2016年12月13日
            
            
        
                s0s0s0s     LV1
                2016年6月3日
            
            
        
最近浏览更多
                
                wens17    
                2021年12月1日
            
            
                    暂无贡献等级
            
        
                阿风啦     LV14
                2021年1月6日
            
            
        
                liangge2115     LV27
                2020年11月25日
            
            
        
                866521     LV2
                2020年10月20日
            
            
        
                jeep123456     LV10
                2020年6月9日
            
            
        
                13940562934     LV22
                2019年11月14日
            
            
        
                opo147741    
                2019年10月14日
            
            
                    暂无贡献等级
            
        
                胖胖来了     LV4
                2019年9月27日
            
            
        
                lelelada     LV8
                2019年7月16日
            
            
        
                紫玉天辰     LV11
                2018年11月1日
            
            
        
                
                
                