Spring-boot,嵌入了tomcat-如何定义catalina.properties? [英] Spring-boot, tomcat-embedded -- how define catalina.properties?
问题描述
在运行带有tomcat嵌入式功能的spring-boot时,
如何设置/更改这些tomcat-config系统属性?
When running spring-boot with tomcat-embedded, how do I set/change these tomcat-config system-properties?
- https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html
我尝试在命令行中仅添加-D ...,但没有
I tried just adding -D... on the commandline, but doesnt seem to work.
推荐答案
我当前在启动spring-boot应用程序时通过命令行定义catalina.properties之一。
I am currently defining one of the catalina.properties via command line when starting my spring-boot application.
我们要添加的属性是: tomcat.util.http.parser.HttpParser.requestTargetAllow
The property we are adding is: tomcat.util.http.parser.HttpParser.requestTargetAllow
我用来运行该应用程序的完整命令是:
The complete command I use to run the application is:
mvn -Dtomcat.util.http.parser.HttpParser.requestTargetAllow={} spring-boot:run
您应该能够附加以下更多的catalina属性:
You should be able to append more catalina properties as follows:
mvn -Dtomcat.util.buf.StringCache.byte.enabled=true -Dtomcat.util.http.parser.HttpParser.requestTargetAllow={} spring-boot:run
,您可以添加此处提到的任何属性:
https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html
And you could add any of the properties you mentioned here: https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html
在以下帖子的帮助下,我最终获得了此解决方案:
I ended up with this solution with the help of following posts:
https://bz.apache.org/bugzilla/show_bug.cgi?id=60594
让我知道它是否对您有用。
Let me know if it works for you.
这篇关于Spring-boot,嵌入了tomcat-如何定义catalina.properties?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!