aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src/main')
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java14
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WwwInitializer.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java9
3 files changed, 5 insertions, 20 deletions
diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java
index 2e5a4f898..8dc8093ec 100644
--- a/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java
+++ b/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java
@@ -33,12 +33,14 @@ public class WwwAppConfiguration {
private UserService userService;
@Inject
private TagService tagService;
+ @Inject
+ private ObjectMapper jsonMapper;
@Bean
public WebApp webApp() throws IOException {
WebApp app = new WebApp();
String manifestString = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("manifest.json"), StandardCharsets.UTF_8);
- HashMap<String, String> manifest = jsonMapper().readValue(manifestString,
+ HashMap<String, String> manifest = jsonMapper.readValue(manifestString,
new TypeReference<HashMap<String, String>>() {});
app.setScriptsUrl(manifest.get("scripts.js"));
app.setStyleUrl(manifest.get("style.css"));
@@ -58,14 +60,4 @@ public class WwwAppConfiguration {
return new HelpService("help");
}
- @Bean
- public ObjectMapper jsonMapper() {
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
- mapper.registerModule(new Jdk8Module());
- return mapper;
- }
-
}
diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwInitializer.java b/juick-www/src/main/java/com/juick/www/configuration/WwwInitializer.java
index 199fbf857..bc5851db8 100644
--- a/juick-www/src/main/java/com/juick/www/configuration/WwwInitializer.java
+++ b/juick-www/src/main/java/com/juick/www/configuration/WwwInitializer.java
@@ -2,6 +2,7 @@ package com.juick.www.configuration;
import com.juick.configuration.DataConfiguration;
import com.juick.configuration.SearchConfiguration;
+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;
@@ -18,6 +19,7 @@ public class WwwInitializer extends AbstractAnnotationConfigDispatcherServletIni
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[]{
+ BaseWebConfiguration.class,
WwwAppConfiguration.class,
DataConfiguration.class,
SearchConfiguration.class,
diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java
index ae51f1cdd..d7e5c72e8 100644
--- a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java
+++ b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java
@@ -31,8 +31,6 @@ import java.util.concurrent.TimeUnit;
@ComponentScan(basePackages = {"com.juick.www.controllers"})
@PropertySource("classpath:juick.conf")
public class WwwServletConfiguration extends WebMvcConfigurationSupport {
- @Inject
- private Environment env;
@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
@@ -61,13 +59,6 @@ public class WwwServletConfiguration extends WebMvcConfigurationSupport {
return result;
}
- @Bean
- public MultipartResolver multipartResolver() {
- CommonsMultipartResolver resolver = new CommonsMultipartResolver();
- resolver.setMaxUploadSize(10000000);
- return resolver;
- }
-
@Inject
private ServletContext servletContext;