spring boot 目录浏览功能 How to enable directory listing in Spring Boot
Posted Dreamer who
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring boot 目录浏览功能 How to enable directory listing in Spring Boot相关的知识,希望对你有一定的参考价值。
@Component
public class CustomizationBean implements WebServerFactoryCustomizer<TomcatServletWebServerFactory>
@Override
public void customize(TomcatServletWebServerFactory factory)
factory.addContextCustomizers(new TomcatContextCustomizer()
@Override
public void customize(Context context)
context.setDocBase("/Users/xxx/opt/Akka");
Wrapper defServlet = (Wrapper) context.findChild("default");
defServlet.addInitParameter("listings", "true");
defServlet.addInitParameter("readOnly", "false");
defServlet.addMapping("/*");
);
测试:
以上是关于spring boot 目录浏览功能 How to enable directory listing in Spring Boot的主要内容,如果未能解决你的问题,请参考以下文章
How to use JDBC-Authentication of Spring Boot/Spring Security with Flyway
Spring Boot文档阅读笔记-how-to-implement-2-way-ssl-using-spring-boot
How to configure spring boot through annotations in order to have something similar to <jsp-confi
转载How to develop your own Boot Loader怎么样开发自己的bootloader