FAQ Database Discussion Community


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

clojure,http-post,paypal-ipn,undertow,immutant
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...

File Upload and acceptable Error Handling on Undertow/Wildfly wth Spring Boot

java,spring-boot,multipartform-data,undertow
We have a project running on Undertow & SpringBoot and are trying to add File Uploads. The first attempts were successful, the Files have been bound to the appropriate Beans by using the StandardServletMultipartResolver and configuring it using the application.properties. However, we ran into terrible difficulties when it came to...

HTTP Handler and Resteasy Deployment with undertow and resteasy

resteasy,wildfly,undertow
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...

Redirect http to https on spring boot embedded undertow

java,spring,spring-boot,undertow
I am using spring boot (1.2.3) and embedded undertow. For security reasons I would prefer to redirect any http request to https but I cannot find an example for doing this. Here is an example for spring boot and tomcat: Spring boot - Embeded Tomcat HTTP to HTTPS redirect Does...

Register new undertow SessionManager

java,wildfly,wildfly-8,session-management,undertow
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?...

Image/Media MIME type responses in Undertow

java,undertow
I've been struggling trying to find a way to deliver .jpeg, .png or other contents in Undertow. Sending byte[] won't work and since Undertow is Non-blocking, I don't want to write the file on the output by doing the usual: exchange.getOutputStream().write(myFileByteArray); Is there any other way I can achieve it?...

Deploying Immutant to WildFly with several contexts

jboss,clojure,wildfly,undertow,immutant
I have an Undertow web server with Immutant (Clojure), my main- looks like this: (run (-> routes/app wrap-something-app-specific wrap-params) (options {:path "/" :port 8080})) (run (-> routes/billing wrap-something-billing-specific) (options {:path "/billing" :port 8081 :worker-threads 4})) When running not in a WildFly countainer, it works just fine: localhost:8080/ maps to app...

Compressing Undertow server responses

java,http-compression,undertow
i have a programmatic Undertow server setup. Static content is served by Undertow as well, without a reverse proxy. Java code for Undertow startup looks like this: ResourceManager resourceManager = new FileResourceManager(new File("deploymentDir"), 100); DeploymentInfo servletBuilder = Servlets.deployment() .setResourceManager(resourceManager) .setDeploymentName("testDeployment") .setContextPath("/"); DeploymentManager manager = Servlets.defaultContainer() .addDeployment(servletBuilder); manager.deploy(); Undertow.Builder builder =...