From ed7758acabca62118e4b883b01bb4293d0adbae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cocula?= Date: Fri, 23 Dec 2016 01:31:29 +0100 Subject: [PATCH] registration of dwr servlet --- .../java/org/libresonic/player/boot/Application.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java b/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java index 297e3e6d..28b75c8e 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java +++ b/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java @@ -1,9 +1,12 @@ package org.libresonic.player.boot; +import org.directwebremoting.servlet.DwrServlet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; @@ -16,6 +19,14 @@ import org.springframework.context.annotation.ImportResource; "classpath:/libresonic-servlet.xml"}) public class Application extends SpringBootServletInitializer { + @Bean + public ServletRegistrationBean dwrServletRegistrationBean() { + ServletRegistrationBean servlet = new ServletRegistrationBean(new DwrServlet(), "/dwr/*"); + servlet.addInitParameter("crossDomainSessionSecurity","false"); + return servlet; + } + + @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { // Customize the application or call application.sources(...) to add sources