新增是否启用默认 Servlet 映射(启用后可访问 webapp 下的静态资源访问)
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||||
|
* No deletion without permission, or be held responsible to law.
|
||||||
|
*/
|
||||||
|
package com.jeesite.modules.config.web;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用默认 Servlet 映射(启用后可访问 webapp 下的静态资源访问)
|
||||||
|
* @author ThinkGem
|
||||||
|
* @version 2022年4月18日
|
||||||
|
*/
|
||||||
|
@Configuration(proxyBeanMethods = false)
|
||||||
|
@ConditionalOnProperty(name="server.servlet.register-default-servlet", havingValue="true", matchIfMissing=false)
|
||||||
|
public class DefaultServletConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
|
||||||
|
configurer.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ server:
|
|||||||
port: 8980
|
port: 8980
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /js
|
context-path: /js
|
||||||
|
register-default-servlet: false
|
||||||
tomcat:
|
tomcat:
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
# 表单请求数据的最大大小
|
# 表单请求数据的最大大小
|
||||||
|
|||||||
Reference in New Issue
Block a user