aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/configuration
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-06-29 17:09:49 +0300
committerGravatar Vitaly Takmazov2017-06-30 10:22:20 +0300
commitc99b9350be030bfbf87829956a182753a81d07a2 (patch)
tree1485ea407aca135eee7815d93a3636ba793a0276 /juick-api/src/main/java/com/juick/api/configuration
parentb75b5a3d1a3bf001923d49923dcebee95ba2327e (diff)
MVC was not enabled in apps based on BaseWebConfiguration
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/configuration')
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java10
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java5
2 files changed, 7 insertions, 8 deletions
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
index 7ef1cf45..520f21eb 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
@@ -2,12 +2,11 @@ package com.juick.api.configuration;
import com.juick.api.ApiServer;
import com.juick.api.TGBot;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
+import com.juick.server.configuration.BaseWebConfiguration;
+import org.springframework.context.annotation.*;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.socket.client.WebSocketConnectionManager;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
@@ -21,7 +20,8 @@ import javax.inject.Inject;
@EnableAsync
@PropertySource("classpath:juick.conf")
@ComponentScan(basePackages = "com.juick.api.controllers")
-public class ApiAppConfiguration {
+@Import(BaseWebConfiguration.class)
+public class ApiAppConfiguration extends WebMvcConfigurationSupport {
@Inject
TGBot tgBot;
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java b/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java
index d01df787..9de0af9d 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java
@@ -1,7 +1,6 @@
package com.juick.api.configuration;
import com.juick.configuration.DataConfiguration;
-import com.juick.server.configuration.BaseWebConfiguration;
import org.apache.commons.codec.CharEncoding;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
@@ -16,14 +15,14 @@ public class ApiInitializer extends AbstractAnnotationConfigDispatcherServletIni
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[]{
- ApiAppConfiguration.class, ApiSecurityConfig.class, DataConfiguration.class,
+ ApiSecurityConfig.class, DataConfiguration.class,
TelegramConfiguration.class, MessengerConfiguration.class
};
}
@Override
protected Class<?>[] getServletConfigClasses() {
- return new Class<?>[]{BaseWebConfiguration.class};
+ return new Class<?>[]{ ApiAppConfiguration.class };
}
@Override