Commit 0524c159 by fengshuonan

更新404页面

parent 7919acd5
......@@ -15,6 +15,7 @@
*/
package cn.stylefeng.guns;
import cn.stylefeng.roses.core.config.WebAutoConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
......@@ -26,7 +27,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author stylefeng
* @Date 2017/5/21 12:06
*/
@SpringBootApplication
@SpringBootApplication(exclude = WebAutoConfiguration.class)
public class GunsApplication {
private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class);
......
......@@ -16,6 +16,7 @@
package cn.stylefeng.guns.config.web;
import cn.stylefeng.guns.config.properties.GunsProperties;
import cn.stylefeng.guns.core.controller.GunsErrorView;
import cn.stylefeng.guns.core.intercept.RestApiInteceptor;
import cn.stylefeng.guns.core.listener.ConfigListener;
import cn.stylefeng.roses.core.xss.XssFilter;
......@@ -38,7 +39,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.Arrays;
import java.util.Properties;
......@@ -50,7 +51,7 @@ import java.util.Properties;
* @date 2016年11月12日 下午5:03:32
*/
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
public class WebConfig implements WebMvcConfigurer {
@Autowired
private GunsProperties gunsProperties;
......@@ -75,6 +76,14 @@ public class WebConfig extends WebMvcConfigurerAdapter {
}
/**
* 默认错误页面,返回json
*/
@Bean("error")
public GunsErrorView error() {
return new GunsErrorView();
}
/**
* druidServlet注册
*/
@Bean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment