Clean up configuration
This commit is contained in:
@@ -18,11 +18,10 @@ import org.springframework.security.web.firewall.StrictHttpFirewall;
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
new SpringApplicationBuilder()
|
||||
.parent(HibernateConfig.class, ServletConfig.class, CommonConfig.class, SecurityConfig.class).web(WebApplicationType.NONE)
|
||||
// .child(MvcAppConfig.class, MvcSecurityConfig.class, SecurityConfig.class, InterceptorsConfig.class).web(WebApplicationType.SERVLET)
|
||||
.child(RestAppConfig.class, ServletConfig.class, InterceptorsConfig.class).web(WebApplicationType.SERVLET)
|
||||
.child(MvcAppConfig.class, MvcSecurityConfig.class, SecurityConfig.class, InterceptorsConfig.class).web(WebApplicationType.SERVLET)
|
||||
.sibling(RestAppConfig.class, ServletConfig.class, InterceptorsConfig.class).web(WebApplicationType.SERVLET)
|
||||
.run(args);
|
||||
}
|
||||
|
||||
|
@@ -22,11 +22,12 @@ import com.wisemapping.filter.UserLocaleInterceptor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Component
|
||||
@Configuration
|
||||
@ComponentScan("com.wisemapping.filter")
|
||||
public class InterceptorsConfig implements WebMvcConfigurer {
|
||||
@Autowired
|
||||
|
@@ -1,9 +1,10 @@
|
||||
package com.wisemapping.config.mvc;
|
||||
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.HandlerExceptionResolver;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
@@ -14,7 +15,8 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
import org.springframework.web.servlet.view.JstlView;
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@EnableWebMvc
|
||||
@ComponentScan("com.wisemapping.webmvc")
|
||||
public class MvcAppConfig implements WebMvcConfigurer {
|
||||
|
@@ -14,7 +14,6 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
public class MvcSecurityConfig {
|
||||
|
||||
@Bean
|
||||
@Order(1)
|
||||
public SecurityFilterChain embeddedDisabledXOrigin(@NotNull final HttpSecurity http, @NotNull final MvcRequestMatcher.Builder mvc) throws Exception {
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package com.wisemapping.config.rest;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
@@ -15,8 +15,8 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
|
||||
import static org.springframework.security.config.Customizer.withDefaults;
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableWebSecurity
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({"com.wisemapping.rest"})
|
||||
public class RestAppConfig {
|
||||
@Bean
|
||||
|
Reference in New Issue
Block a user