undertow

Register new undertow SessionManager

谁说我不能喝 提交于 2019-12-06 07:06:35
问题 I have wildfly 8.1 server running. I have my own SessionManager implementing io.undertow.server.session.SessionManager. And i want to configure the system to use my session manager. Where and how should i configure/add new settings for my session manager? 回答1: public class StartupBeanExtension implements Extension, ServletExtension { @Override public void handleDeployment(DeploymentInfo deployment, ServletContext context) { boolean sessionPersistenceEnabled = Boolean.parseBoolean(BeanUtils

Clojure Immutant 2 server Undertow; how to handle http POST?

守給你的承諾、 提交于 2019-12-06 06:01:30
Putting the following line into my compojure defroutes to use clojure-paypal-ipn calling the two handler functions. (POST "/paypal/ipn" [] (make-ipn-handler payment/paypal-data payment/paypal-error)) How do I handle a POST request within Immutant? I'm using Immutant 2.0 with Clojure 1.7-beta1 and building off the Immutant feature demo. Posting directly with cURL give these same results, although I'm trying to use PayPal IPN. 17:29:40.220 ERROR [io.undertow.request] (XNIO-1 task-1) Undertow request failed HttpServerExchange{ POST /paypal/ipn} java.io.IOException: mark/reset not supported at

How do I configure Undertow handlers to support proper rewriting for SPA bookmarking?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 04:52:01
I am trying to configure JBoss EAP 7 (via Undertow) to properly rewrite any SPA URLS back to the SPA's index.html using Undertow handlers. Unfortunately, my API is located at /api , so I need to let any requests pass through which start with /api . Here is my current configuration (lifted from another SO answer): not equals(%R, '/my-app') and not equals(%R, '/my-app/') and not equals(%R, '/my-app/index.html') and not path-prefix('/my-app/api') and not regex('/my-app/.*\.js') and regex('/my-app/.+') -> rewrite('/my-app/index.html') Unfortunately, this doesn't seem to be rewriting anything. How

jboss7-Undertow web子模块配置

巧了我就是萌 提交于 2019-12-05 23:22:19
1、需要启用模块 <extension module="org.wildfly.extension.undertow"/> 2、默认配置如下 <subsystem xmlns="urn:jboss:domain:undertow:1.0"> <buffer-caches> <buffer-cache name="default" buffer-size="1024" buffers-per-region="1024" max-regions="10"/> </buffer-caches> <server name="default-server"> <http-listener name="default" socket-binding="http" /> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content" /> </host> </server> <servlet-container name="default" default-buffer-cache="default" stack-trace-on-error="local-only" > <jsp-config/> <persistent-sessions/> </servlet

java.lang.ClassNotFoundException: sun.misc.Cleaner

拟墨画扇 提交于 2019-12-05 11:45:30
When using Undertow 1.4.20 (as embedded Servlet engine), i get this exception when running our app under Java 9.=: java.lang.ClassNotFoundException: sun.misc.Cleaner Cause is this line in io.undertow.server.DirectByteBufferDeallocator : tmpCleanerClean = Class.forName("sun.misc.Cleaner").getMethod("clean"); This class does indeed not exists anymore in Java 9. But a replacement is available: java.lang.ref.Cleaner Can i ignore this exception for now? Is there a timeline for fixing this (i.e. making undertow Java 9 compatible)? This was indeed a bug, resolved in 2.0.0.Alpha2 and 1.4.21.Final. See

Compojure handler friend/authenticate eats body of POST request

杀马特。学长 韩版系。学妹 提交于 2019-12-05 10:55:35
How can I safely get the content of the :body InputStream from compojure? See related but different question for background. I'm trying to authenticate my ring routes with Friend using compojure handler/site but when I try to read the :body from an http POST request (which is a Java InputStream ), it is closed: 23:01:20.505 ERROR [io.undertow.request] (XNIO-1 task-3) Undertow request failed HttpServerExchange{ POST /paypal/ipn} java.io.IOException: UT000034: Stream is closed at io.undertow.io.UndertowInputStream.read(UndertowInputStream.java:84) ~[undertow-core-1.1.0.Final.jar:1.1.0.Final] at

Spring Boot Tomcat配置项

夙愿已清 提交于 2019-12-05 07:09:39
参数配置容器 server.xx开头的是所有servlet容器通用的配置,server.tomcat.xx开头的是tomcat特有的参数,其它类似。 所有参数绑定配置类:org.springframework.boot.autoconfigure.web.ServerProperties # EMBEDDED SERVER CONFIGURATION (ServerProperties) server.address= # Network address to which the server should bind to. server.compression.enabled=false # If response compression is enabled. server.compression.excluded-user-agents= # List of user-agents to exclude from compression. server.compression.mime-types= # Comma-separated list of MIME types that should be compressed. For instance `text/html,text/css,application/json` server.compression.min

HTTP Handler and Resteasy Deployment with undertow and resteasy

大兔子大兔子 提交于 2019-12-05 06:31:34
I am trying to run both HTTPServer and also the REST Handler. Only one works at a time not able to make it work both at same time. I need to serve html pages and also the api. here is my code. public class HttpServer { private final UndertowJaxrsServer server = new UndertowJaxrsServer(); private static String rootPath = System.getProperty("user.dir"); private final Undertow.Builder serverBuilder; public HttpServer(Integer port, String host) { serverBuilder = Undertow .builder() .addHttpListener(port, host) .setHandler( Handlers.path().addPrefixPath( "/", Handlers.resource( new

Hosting multiple domains with WildFly (Undertow)

微笑、不失礼 提交于 2019-12-05 06:25:34
For example I have two domains ( app1.com , app2.com ) and two ears ( app1.ear , app2.ear ). Each EAR file consists of ejb.jar and web.war. Also each WAR has context root: /app1 or /app2 . So if I start WildFly I will have two applications running on localhost:8080/app1 and localhost:8080/app2 . How I can bind app1.com to localhost:8080/app1 and app2.com to localhost:8080/app2 ? As I understand, I should modify Undertow subsystem configuration in standalone.xml. I tried: <server name="default-server"> <http-listener name="default" socket-binding="http"/> <host name="app1.com" default-web

Use Undertow to serve AngularJS

寵の児 提交于 2019-12-05 02:05:09
问题 I would like to use Undertow as a simple web server for serving an AngularJS application. The rest services needed by the AngularJS application is served by Apache Camel so I would only need to serve the Angular App using Undertow. I have read the documentation but cannot get it working, any ideas on what I am doing wrong? Here is the code that I have now for starting Underow server Undertow server = Undertow.builder() .addHttpListener(8080, "localhost") .setHandler(resource(new