Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServletContext 414行getRealPath方法中resourceManager是null #34

Open
WenTao-Love opened this issue Jun 12, 2024 · 12 comments
Open

ServletContext 414行getRealPath方法中resourceManager是null #34

WenTao-Love opened this issue Jun 12, 2024 · 12 comments

Comments

@WenTao-Love
Copy link

环境:springboot2.7.18
请问如何初始化ServletContext 中的resourceManager呢?
让他读取static、template资源文件夹,谢谢

@wangzihaogithub
Copy link
Owner

springboot2.7.18我刚试了下,resourceManager不是null呢。

可选配置,不配置就等于临时文件夹

server.netty.http-servlet.basedir=资源文件夹

@wangzihaogithub
Copy link
Owner

方便给个截图或者demo让我复现一下吗

@WenTao-Love
Copy link
Author

WenTao-Love commented Jun 12, 2024

可能是我们使用了beetl Html引擎
<!-- https://mvnrepository.com/artifact/com.ibeetl/beetl-spring-classic --> <dependency> <groupId>com.ibeetl</groupId> <artifactId>beetl-spring-classic</artifactId> <version>3.16.2.RELEASE</version> </dependency>

@WenTao-Love
Copy link
Author

application.yml
beetl: suffix: html

@WenTao-Love
Copy link
Author

1718175380696_d

@wangzihaogithub
Copy link
Owner

我明天试下,下午开会了

wangzihaogithub pushed a commit that referenced this issue Jun 13, 2024
解决ServletContext 414行getRealPath方法中resourceManager是null #34
#34
@wangzihaogithub
Copy link
Owner

解决了,晚上发版到maven中央仓 2.3.18

@WenTao-Love
Copy link
Author

优秀的大佬,那我明天就从tomcat切换过来试试,支持一波。

@WenTao-Love
Copy link
Author

强呀,的确可以了。可以稍微优化一下pom.xml引入吗?

@WenTao-Love
Copy link
Author

1718326329720_d
现在仍需要手动引入servlet、netty依赖

@wangzihaogithub
Copy link
Owner

可以,下个版本2.7.19发版时,改成强依赖

@WenTao-Love
Copy link
Author

期待,这样子更方便改造pom.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants