Skip to content

Commit b7f5b54

Browse files
committed
spring related updates
1) scan package for config classes rather than manually registering them one by one. this will make implementing extensions easier without changing / touching the core of SteVe 2) EnableWebSecurity replaces the deprecated EnableWebMvcSecurity
1 parent ca0b85a commit b7f5b54

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/main/java/de/rwth/idsg/steve/SteveAppContext.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package de.rwth.idsg.steve;
22

3-
import de.rwth.idsg.steve.config.BeanConfiguration;
4-
import de.rwth.idsg.steve.config.OcppConfiguration;
5-
import de.rwth.idsg.steve.config.SecurityConfiguration;
6-
import de.rwth.idsg.steve.config.WebSocketConfiguration;
73
import org.apache.cxf.Bus;
84
import org.apache.cxf.BusFactory;
95
import org.apache.cxf.common.logging.LogUtils;
@@ -42,10 +38,7 @@ public class SteveAppContext {
4238

4339
public SteveAppContext() {
4440
springContext = new AnnotationConfigWebApplicationContext();
45-
springContext.register(BeanConfiguration.class);
46-
springContext.register(OcppConfiguration.class);
47-
springContext.register(SecurityConfiguration.class);
48-
springContext.register(WebSocketConfiguration.class);
41+
springContext.scan("de.rwth.idsg.steve.config");
4942
}
5043

5144
public HandlerCollection getHandlers() throws IOException {

src/main/java/de/rwth/idsg/steve/config/SecurityConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
77
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
88
import org.springframework.security.config.annotation.web.builders.WebSecurity;
9+
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
910
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
10-
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
1111

1212
/**
1313
* @author Sevket Goekay <goekay@dbis.rwth-aachen.de>
1414
* @since 07.01.2015
1515
*/
1616
@Configuration
17-
@EnableWebMvcSecurity
17+
@EnableWebSecurity
1818
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
1919

2020
@Autowired

0 commit comments

Comments
 (0)