2017-06-05 152 views
2

当使用tomcat-embedded运行spring-boot时, 如何设置/更改这些tomcat-config系统属性?Spring-boot,tomcat-embedded - 如何定义catalina.properties?

我想只是增加-D ...在命令行,但似乎没有工作。

+1

您可以查看[常见应用程序属性](https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html)&[嵌入式servlet容器](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html) –

+0

你的第一个链接提供了,我猜,春季等值的几个上面的tomcat系统属性,但在tomcat-doc中还有很多...你的第二个链接 - 很难消化我认为....有没有简单的方法来设置运行嵌入式时的tomcat-doc属性?或者一个示例/链接如何使用配置器等,如果需要实现它,将会有所帮助。 – Rop

回答

0

我目前正在通过命令行定义一个catalina.properties启动我的弹簧引导应用程序时。

我们添加的属性为:tomcat.util.http.parser.HttpParser.requestTargetAllow

我用它来运行应用程序的完整命令是:

mvn -Dtomcat.util.http.parser.HttpParser.requestTargetAllow={} spring-boot:run 

您应该能够添加更多的卡塔利娜属性如下:

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

我结束了这种解决方案具有以下职位的帮助:

https://bz.apache.org/bugzilla/show_bug.cgi?id=60594

Invalid character found in the request target in spring boot

让我知道它是否适合你。

相关问题