首页>代码>基于springboot实现分布式开源bbs论坛系统,maven多模块搭建>/quark-admin/src/main/java/com/quark/admin/AdminApplication.java
package com.quark.admin; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; import org.springframework.boot.web.servlet.ErrorPage; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.http.HttpStatus; import java.io.IOException; import java.io.InputStream; import java.util.Properties; /** * Created by lhr on 17-7-31. */ @SpringBootApplication @EnableCaching//缓存支持 public class AdminApplication { @Bean public EmbeddedServletContainerCustomizer containerCustomizer() { return (container -> { ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401.html"); ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html"); ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500.html"); container.addErrorPages(error401Page, error404Page, error500Page); }); } public static void main(String[] args) throws IOException { //更改properties配置文件名称,避免依赖冲突 Properties properties = new Properties(); InputStream in = AdminApplication.class.getClassLoader().getResourceAsStream("admin.properties"); properties.load(in); SpringApplication app = new SpringApplication(AdminApplication.class); app.setDefaultProperties(properties); app.run(args); // SpringApplication.run(CommonApplication.class, args); } }
最近下载更多
lovelyy LV11
2月1日
微笑刺客 LV15
2023年12月27日
liuyuheng LV17
2023年11月15日
limin123 LV6
2023年6月11日
Antuz56 LV2
2023年6月6日
122933615 LV3
2023年4月26日
谢谢谢谢谢谢你 LV6
2022年8月25日
13043860zj LV16
2022年7月11日
molu123456
2022年7月7日
暂无贡献等级
李涛11111 LV8
2022年6月16日
最近浏览更多
Gin19960217 LV4
3月15日
西瓜哥哥 LV4
3月5日
yxzzxy LV3
1月19日
zcwmmd LV20
1月8日
chfismine
1月8日
暂无贡献等级
微笑刺客 LV15
2023年12月27日
hhh12345 LV7
2023年12月23日
wutongzui11
2023年12月13日
暂无贡献等级
空中飞尘 LV13
2023年12月13日
lasttimeapp
2023年11月27日
暂无贡献等级