package com.nbclass.component;

import java.util.Map;

import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.WebRequest;

/**
 * @version V1.0
 * @date 2018年7月11日
 * @author superzheng
 */
@Component
public class MyErrorAttributes extends DefaultErrorAttributes{

    @Override
    public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
        @SuppressWarnings("deprecation")
		Map<String,Object> map  = super.getErrorAttributes(webRequest, includeStackTrace);
        @SuppressWarnings("unchecked")
		Map<String,Object> ext = (Map<String,Object>)webRequest.getAttribute("ext", 0);
        map.put("ext",ext);
        return map;
    }
    
}
