Commit 0524c159 by fengshuonan

更新404页面

parent 7919acd5
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package cn.stylefeng.guns; package cn.stylefeng.guns;
import cn.stylefeng.roses.core.config.WebAutoConfiguration;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
...@@ -26,7 +27,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -26,7 +27,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author stylefeng * @author stylefeng
* @Date 2017/5/21 12:06 * @Date 2017/5/21 12:06
*/ */
@SpringBootApplication @SpringBootApplication(exclude = WebAutoConfiguration.class)
public class GunsApplication { public class GunsApplication {
private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class); private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package cn.stylefeng.guns.config.web; package cn.stylefeng.guns.config.web;
import cn.stylefeng.guns.config.properties.GunsProperties; 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.intercept.RestApiInteceptor;
import cn.stylefeng.guns.core.listener.ConfigListener; import cn.stylefeng.guns.core.listener.ConfigListener;
import cn.stylefeng.roses.core.xss.XssFilter; import cn.stylefeng.roses.core.xss.XssFilter;
...@@ -38,7 +39,7 @@ import org.springframework.context.annotation.Configuration; ...@@ -38,7 +39,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener; import org.springframework.web.context.request.RequestContextListener;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 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.Arrays;
import java.util.Properties; import java.util.Properties;
...@@ -50,7 +51,7 @@ import java.util.Properties; ...@@ -50,7 +51,7 @@ import java.util.Properties;
* @date 2016年11月12日 下午5:03:32 * @date 2016年11月12日 下午5:03:32
*/ */
@Configuration @Configuration
public class WebConfig extends WebMvcConfigurerAdapter { public class WebConfig implements WebMvcConfigurer {
@Autowired @Autowired
private GunsProperties gunsProperties; private GunsProperties gunsProperties;
...@@ -75,6 +76,14 @@ public class WebConfig extends WebMvcConfigurerAdapter { ...@@ -75,6 +76,14 @@ public class WebConfig extends WebMvcConfigurerAdapter {
} }
/** /**
* 默认错误页面,返回json
*/
@Bean("error")
public GunsErrorView error() {
return new GunsErrorView();
}
/**
* druidServlet注册 * druidServlet注册
*/ */
@Bean @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