embedded-tomcat-8

Thymeleaf-template not found with embedded tomcat

夙愿已清 提交于 2019-12-14 02:51:22
问题 At my program sze I tried to switch to embedded tomcat. Unfortunately I run into trouble, because the following thymeleaf-construct can't be solved. <th:block th:include="/main::head"/> The main.html is in the same directory as login.html which shows the failure. I got the following exception org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/main", template might not exist or might not be accessible by any of the configured Template Resolvers (login:5) at org

Spring-boot, tomcat-embedded — how define catalina.properties?

六眼飞鱼酱① 提交于 2019-12-12 17:15:19
问题 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 I tried just adding -D... on the commandline, but doesnt seem to work. 回答1: I am currently defining one of the catalina.properties via command line when starting my spring-boot application. The property we are adding is: tomcat.util.http.parser.HttpParser.requestTargetAllow The complete command I use to run the application

Set jvmRoute in spring boot 2.0.0

拜拜、爱过 提交于 2019-12-12 09:52:21
问题 For sticky session i need to set the jvmRoute of the embedded tomcat. Actually only a System.setProperty("jvmRoute", "node1"); is required, but i want to set a via application.properties configurable property. I don't know how and when to set this with @Value annotated property. With @PostConstruct as described here, it does not work (at least not in spring boot 2.0.0.RELEASE) The only way i found so far is @Component public class TomcatInitializer implements ApplicationListener

How can I get the current number of client request threads in spring boot embedded tomcat?

China☆狼群 提交于 2019-12-11 01:47:05
问题 I'd like to get the current number of active client request threads in a spring boot app using embedded tomcat so that I can expose it over actuator's metrics endpoint. I'm not looking for active sessions, but active request processing threads. Preferably, I'd like to get this data per connector as well. Does anyone have any ideas on a good way to get at this information in spring boot? 回答1: I don't know if this is what you are looking for, but you can get serveral values like that via JMX.

Json Views template not found when run as a war file

泪湿孤枕 提交于 2019-12-08 13:48:13
问题 I am using Json views plugin of grails. Which works in development, but when I run it as a jar file, it is not able to find the templates/gson files for rendering. I get the following error //code def template = jsonViewTemplateEngine.resolveTemplate(<path to template>) def writable = template.make(kase: kase) //exception Cannot invoke method make() on null object. Stacktrace follows: java.lang.NullPointerException: Cannot invoke method make() on null object Json Views we are using are a part

404 when deploying Grails 3.1.10 war to tomcat7 or tomcat8

一曲冷凌霜 提交于 2019-12-08 05:59:44
问题 The closest stackoverflow question that explains my symptoms is here - How can I deploy a Grails 3.0.1 war file in Tomcat7? I am in the process of upgrading a Grails 2.3.4 application to Grails 3.1.10 and everything is working with 'grails run-app'. When i deploy to a war i get nothing but 404's for any url. The war deploys without any error messages in catalina.out. The tomcat access logs show my access attempts. (not linux problem?) I can get to the tomcat manager, and the tomcat manager

Spring boot - Embedded Tomcat - Connector Customizer - fail to add parseBodyMethods attributes

我的未来我决定 提交于 2019-12-08 04:26:49
问题 The original problem is when I sent a http request with method 'DELETE', the body part couldn't be sent to the server. After googling, I found this article that suggests modifying the server.xml file and adding 'parseBodyMethods' to the Connector part can solve the problem: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" parseBodyMethods="POST,PUT,DELETE" redirectPort="8443" /> However, because I'm using spring's embedded tomcat, I have to find a way to do the same in

Spring boot - Embedded Tomcat - Connector Customizer - fail to add parseBodyMethods attributes

萝らか妹 提交于 2019-12-06 16:57:09
The original problem is when I sent a http request with method 'DELETE', the body part couldn't be sent to the server. After googling, I found this article that suggests modifying the server.xml file and adding 'parseBodyMethods' to the Connector part can solve the problem: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" parseBodyMethods="POST,PUT,DELETE" redirectPort="8443" /> However, because I'm using spring's embedded tomcat, I have to find a way to do the same in spring's way. So, I found this article that seems to allow me to add ConnectorCustomizer and add

Set jvmRoute in spring boot 2.0.0

若如初见. 提交于 2019-12-06 02:50:01
For sticky session i need to set the jvmRoute of the embedded tomcat. Actually only a System.setProperty("jvmRoute", "node1"); is required, but i want to set a via application.properties configurable property. I don't know how and when to set this with @Value annotated property. With @PostConstruct as described here , it does not work (at least not in spring boot 2.0.0.RELEASE) The only way i found so far is @Component public class TomcatInitializer implements ApplicationListener<ServletWebServerInitializedEvent> { @Value("${tomcat.jvmroute}") private String jvmRoute; @Override public void

Can not post form with many (over 256) values

时光总嘲笑我的痴心妄想 提交于 2019-12-05 18:07:38
问题 I am using Spring Boot 1.2.2 with Thymeleaf. My Problem is I try to post a long list of Items (some labels, one checkbox) in a form, which cant be perform so many items of my list. (I tested small lists and it worked.) First I used jetty but got an error, which says: java.lang.IllegalStateException: Form too many keys at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To(UrlEncoded.java:526) I searched and saw this post. As the result I added applicationDefaultJvmArgs = ["-Dorg.eclipse.jetty