embedded-tomcat-8

Spring Boot does not honor @WebServlet

痞子三分冷 提交于 2019-12-05 16:32:21
问题 I created a Servlet (extending from HttpServlet) and annotated as per 3.0 specs with @WebServlet(name="DelegateServiceExporter", urlPatterns={"/remoting/DelegateService"}) My @Configuration class in Spring Boot scans this servlet's package. However, it does not log that it has deployed this servlet in the embedded Tomcat 8.0.15 container when my Spring Boot application starts up. So, I added @Component to my servlet as well. Now, Spring Boot registers the servlet (proving to me that the scan

Spring Boot does not honor @WebServlet

☆樱花仙子☆ 提交于 2019-12-04 01:41:23
I created a Servlet (extending from HttpServlet) and annotated as per 3.0 specs with @WebServlet(name="DelegateServiceExporter", urlPatterns={"/remoting/DelegateService"}) My @Configuration class in Spring Boot scans this servlet's package. However, it does not log that it has deployed this servlet in the embedded Tomcat 8.0.15 container when my Spring Boot application starts up. So, I added @Component to my servlet as well. Now, Spring Boot registers the servlet (proving to me that the scan package was correctly set up), but then it registers it with a URL pattern based on a class name using

Embedded Tomcat logging over logback / sl4j

随声附和 提交于 2019-12-03 15:51:35
How can I make an embedded tomcat write its logs over logback? I found some info about using a standalone tomcat with log4j. But how does the setup look like for an embedded tomcat and logback? These are the maven dependencies: <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>${logback.version}</version> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> <version>${tomcat.version}</version> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed

How to convert a subdomain to a path with Embedded Tomcat 8 and Spring boot

随声附和 提交于 2019-12-03 12:55:32
问题 How to rewrite subdomains to paths? Example: foo.bar .example.com --> example.com /foo/bar Or better would be (reverse folders): foo.bar .example.com --> example.com /bar/foo Requesting foo.bar .example.com should ship a file in /src/main/resources/static/ bar/foo /index.html. With Apache2 it is done by mod_rewrite . I found documentation about rewriting with Tomcat 8 but the question is where to put this files using spring boot? Update I tried using the UrlRewriteFilter, but it seems not

The temporary upload location [/tmp/tomcat.4296537502689403143.5000/work/Tomcat/localhost/ROOT] is not valid

此生再无相见时 提交于 2019-12-03 08:35:38
问题 I am using Spring Boot 1.5.13 version. I got the exception message like below. Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.4296537502689403143.5000/work/Tomcat/localhost/ROOT] is not valid I founded out this issue in Spring Github Issues. https://github.com/spring-projects/spring-boot/issues/9616 But I still have questions of that. I am not using File Upload things in my app. But the log says that "Could not

How to convert a subdomain to a path with Embedded Tomcat 8 and Spring boot

与世无争的帅哥 提交于 2019-12-03 03:12:00
How to rewrite subdomains to paths? Example: foo.bar .example.com --> example.com /foo/bar Or better would be (reverse folders): foo.bar .example.com --> example.com /bar/foo Requesting foo.bar .example.com should ship a file in /src/main/resources/static/ bar/foo /index.html. With Apache2 it is done by mod_rewrite . I found documentation about rewriting with Tomcat 8 but the question is where to put this files using spring boot? Update I tried using the UrlRewriteFilter , but it seems not possible to define rules in the domain path using regexes substitution. This is my configuration: Maven

The temporary upload location [/tmp/tomcat.4296537502689403143.5000/work/Tomcat/localhost/ROOT] is not valid

▼魔方 西西 提交于 2019-12-02 22:26:23
I am using Spring Boot 1.5.13 version. I got the exception message like below. Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.4296537502689403143.5000/work/Tomcat/localhost/ROOT] is not valid I founded out this issue in Spring Github Issues. https://github.com/spring-projects/spring-boot/issues/9616 But I still have questions of that. I am not using File Upload things in my app. But the log says that "Could not parse multipart servlet request" why is that? (I got the exception when my app uses RestTemplate (Post

servlet not forwarding session attribute to jsp

那年仲夏 提交于 2019-12-02 07:09:37
问题 Using embedded tomcat, this code works: Servlet : String test = "test"; request.setAttribute("test", test); request.getRequestDispatcher("/index.jsp").forward(request, response); JSP : <%= request.getAttribute("test") %> It sets the attribute test and then prints it out on the servlet /example 's jsp page example.jsp . However, if I try to set the attribute within the session then I don't get the same result, instead, I get a null when using this: Servlet : String test = "test"; request

Spring-Boot with JSP Tag Libs in embedded Tomcat

天涯浪子 提交于 2019-12-01 19:22:52
问题 I am currently migrating a Spring MVC Webapp (xml-config to java-config, tomcat to embedded tomcat via spring-boot). The webapp uses freemarker as templating engine and JSP Taglibs. Now when I call a freemarker page I get the following error: freemarker.ext.jsp.TaglibFactory$TaglibGettingException: No TLD was found for the "http://www.springframework.org/tags/form" JSP taglib URI. (TLD-s are searched according the JSP 2.2 specification. In development- and embedded-servlet-container setups

Spring Boot Embedded Tomcat Dependency Throws Exception On Startup

独自空忆成欢 提交于 2019-12-01 07:54:25
I'm porting an old application from JBoss/Wildfly to run on tomcat. Most everything I've been able to accomplish with the resources found on the web. However, I am not having much luck with the latest issue. I learned early on that I had to add providedRuntime('org.apache.tomcat.embed:tomcat-embed-jasper') as a dependency for request routing. If I don't include this dependency, I will get 404 errors when making a request. Now, this doesn't appear to have any adverse effect on my application, but I don't appreciate startup errors if nothing is wrong. The target environment for this is AWS