Commit 4cb69ac9 authored by igoshin's avatar igoshin

#12869 Fix "File "null" not found"

parent 827d48e1
......@@ -499,7 +499,17 @@
<version>${jetty.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>${jetty.version}</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.data</groupId>-->
<!--<artifactId>spring-data-jpa</artifactId>-->
<!--<version>1.5.1.RELEASE</version>-->
<!--</dependency>-->
</dependencies>
<build>
<plugins>
......
......@@ -16,10 +16,6 @@
package org.genesys2.server.service.impl;
import java.util.Arrays;
import javax.mail.internet.MimeMessage;
import org.genesys2.server.service.EMailService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -31,6 +27,9 @@ import org.springframework.mail.javamail.MimeMessagePreparator;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import javax.mail.internet.MimeMessage;
import java.util.Arrays;
@Service
public class EMailServiceImpl implements EMailService {
......
......@@ -7,6 +7,7 @@ import org.springframework.context.annotation.ImportResource;
@Configuration
@Import({
SpringServletConfig.class,
SpringCommonConfig.class,
SpringAclConfig.class,
SpringSchedulerConfig.class,
......
......@@ -2,7 +2,6 @@ package org.genesys2.spring.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
......@@ -12,12 +11,13 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@Configuration
public class SpringSchedulerConfig {
@Bean
public TaskExecutor taskExecutor() {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setMaxPoolSize(16);
taskExecutor.afterPropertiesSet();
return taskExecutor;
public ThreadPoolTaskExecutor taskExecutor() {
ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor();
pool.setCorePoolSize(5);
pool.setMaxPoolSize(16);
return pool;
}
}
......@@ -9,12 +9,12 @@ import org.springframework.context.annotation.*;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.validation.Validator;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.theme.CookieThemeResolver;
import org.springframework.web.servlet.theme.ThemeChangeInterceptor;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import java.util.HashSet;
import java.util.Locale;
......@@ -23,7 +23,7 @@ import java.util.Set;
@EnableWebMvc
@EnableAspectJAutoProxy
@ComponentScan(basePackages = {"org.genesys2.server.servlet.filter","org.genesys2.server.servlet.controller"})
@ComponentScan(basePackages = {"org.genesys2.server.servlet.filter", "org.genesys2.server.servlet.controller"})
@Configuration
public class SpringServletConfig extends WebMvcConfigurerAdapter {
......@@ -33,9 +33,24 @@ public class SpringServletConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
super.addResourceHandlers(registry);
registry.addResourceHandler("/html/**").addResourceLocations("/html/");
}
@Bean
public ViewResolver viewResolver() {
org.springframework.web.servlet.view.InternalResourceViewResolver resolver = new org.springframework.web.servlet.view.InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/jsp");
resolver.setSuffix(".jsp");
resolver.setExposeContextBeansAsAttributes(true);
resolver.setExposedContextBeanNames(new String[]{"props", "jspHelper"});
resolver.setRedirectHttp10Compatible(false);
resolver.setRequestContextAttribute("requestContext");
return resolver;
}
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
......@@ -74,18 +89,6 @@ public class SpringServletConfig extends WebMvcConfigurerAdapter {
return propertyPlaceholderConfigurer;
}
@Bean
public InternalResourceViewResolver viewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/jsp/");
resolver.setSuffix(".jsp");
resolver.setExposeContextBeansAsAttributes(true);
resolver.setExposedContextBeanNames(new String[]{"props", "jspHelper"});
resolver.setRedirectHttp10Compatible(false);
resolver.setRequestContextAttribute("requestContext");
return resolver;
}
@Bean
public SimpleMappingExceptionResolver simpleMappingExceptionResolver() {
Properties properties = new Properties();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment