undertow

405 error on Webservices calls after migrating spring-boot 1.5 to 2.0

大城市里の小女人 提交于 2019-12-24 07:40:03
问题 I am facing an unsolvable problem with my poor spring configuration knowledge: every GET return error 404 and every POST return error 405 . My spring security filters work well but neither @PostMapping or @GetMapping annotated methods are getting called. I have taken care of rename old property server.context-path to new name server.servlet.context-path but it still not working. I use undertow webserver: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter

Wildfly / Undertow : Multiple aliases for one host

喜欢而已 提交于 2019-12-21 13:43:12
问题 In standalone/configuration/standalone-full.xml , I've declared the following host, that works <host name="webhost" alias="gateway.example.com" /> When I try to add another alias, I'm given Error 404. <host name="webhost" alias="gateway.example.com www.gateway.example.com"/> The DOCUMENTATION says list of aliases is whitespace separated. 回答1: There was a bug in documentation. It is comma separated list of hosts not white space separated. example would be <host name="default-host" alias=

If a web server is non-blocking, does this mean it is handling IO the same as node.js?

醉酒当歌 提交于 2019-12-21 10:17:54
问题 I will soon be using a server named Undertow. The website says: Undertow is a flexible performant web server written in java, providing both blocking and non-blocking API’s based on NIO If Undertow allows non-blocking, is that the same as node.js? I don't mean the languages or anything like that. I have a separate project where I thought node.js would have been a good choice, but if I can use a single product for multiple projects it would be helpful. EDIT: I found this question. Java NIO non

Redirect to a different host in Spring Boot (non-www to www URL)

≯℡__Kan透↙ 提交于 2019-12-20 05:56:01
问题 I have configured my project with a self signed certificate and have configured to redirect insecure http to https. I also want to redirect a request to a host without a " www. " prefix to a host that does, like when we make a request to https://google.com its automatically redirected to https://www.google.com. Now in order to do so, I have found a library called UrlRewriteFilter but this library has configuration available in XML. I tried to convert the XML configuration to java equivalent

170322、Spring Boot 性能优化之将Servlet容器变成Undertow

末鹿安然 提交于 2019-12-20 00:14:26
需求缘起:在研究Spring Boot加速启动的时候,发现我们在实际中,可能比较注重我们服务器的内存的情况,那么我们会想如果在启动的时候,所占用的内存越低是越好,基于这个想法,我们看看Spring Boot启动之后的一个内存占用情况。 我们看看本节的大纲: (1)Spring Boot之Tomcat内存情况; (2)Spring Boot之Undertow内存情况; 接下来看下具体看下每个部分的内容: (1)SpringBoot之Tomcat内存情况; 我们知道,默认情况下,Spring Boot使用Tomcat来作为内嵌的Servlet容器。我们启动项目之后可以使用VisualVM进行查看应用所占的内存情况: (1)进入到你的jdk的安装目录下bin,找到:jvisualvm.exe,双击打开 (2)双击打开之后,你能在左边操作栏找到【本地】--【应用程序的包名】--【双击打开】: 以上是我使用Spring Boot默认的方式启动应用后,用VisualVM监控到的内存占用情况:堆内存占用50M,17个线程被开启。没有比较就没有伤害,一比较我吓一跳,哈哈,单独的一个tomcat是无法看出来效果的,我们看看Undertow的情况下。 (2)SpringBoot之Undertow内存情况; 我们将Web服务器切换到Undertow来提高应用性能

Redirect HTTP to HTTPS in Undertow

半城伤御伤魂 提交于 2019-12-19 11:02:13
问题 How can one configure HTTP->HTTPS redirection in Undertow? I've looked through Undertow's codebase, there are some classes that seem to be relevant (e.g. RedirectHandler). Also, Undertow documentation (Predicates Attributes and Handlers) seems to target exactly this problem among others. But I'm not sure where to start. Basically, what I'm looking for is some counterpart to Apache's mod_rewrite configuration: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%

Jfinal undertow本地运行加载静态文件

本秂侑毒 提交于 2019-12-17 23:26:39
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> undertow部署文档中可配置静态资源 也可以添加磁盘目录作为项目中得静态文件访问 undertow.resourcePath = src/main/webapp, D:/static 这样配置就可以直接通过当前ip端口+static下得文件名直接访问静态文件 少一步配置静态文件目录得操作 来源: oschina 链接: https://my.oschina.net/u/3630262/blog/3144200

How to configure Wildfly to serve static content (like images)?

一个人想着一个人 提交于 2019-12-17 03:54:41
问题 I have a JavaEE application running on Wildfly 8.0.0 Final. The application uses a lot of images and I don't want to store them in the database, so they are written to the hard disk. How can I configure Wildfly/Undertow in order to serve these files (/var/images) on a certain URL, for example http://localhost:8080/myapplication/imagesFromDisk ? 回答1: Add another file handler and another location to the undertow subsystem in standalone.xml: <server name="default-server"> <http-listener name=

How to configure Wildfly to serve static content (like images)?

谁说我不能喝 提交于 2019-12-17 03:54:16
问题 I have a JavaEE application running on Wildfly 8.0.0 Final. The application uses a lot of images and I don't want to store them in the database, so they are written to the hard disk. How can I configure Wildfly/Undertow in order to serve these files (/var/images) on a certain URL, for example http://localhost:8080/myapplication/imagesFromDisk ? 回答1: Add another file handler and another location to the undertow subsystem in standalone.xml: <server name="default-server"> <http-listener name=

Embedded JAX-RS CDI (Undertow, RestEasy & Weld)

只愿长相守 提交于 2019-12-13 03:46:22
问题 I've been trying in the last couple of days to setup an embedded Undertow server, with JAX-RS, using RestEasy, and CDI using weld. No matter what I do, nothing seems to work. I've read through every possible answer, and demo available I could find; Nothing worked! The JAX-RS resource: @Path("/") @Produces(MediaType.TEXT_PLAIN) @RequestScoped public class EchoResource { @Inject @Named("upperCase") private UpperCaseTextProcessing upperCaseTextProcessing; @Inject @Named("lowerCase") private