Merge pull request #9303 from amit2103/JAVA-1556
modified MvcVoterConfig controller path
This commit is contained in:
commit
781812ae2d
|
@ -106,6 +106,10 @@
|
||||||
<version>${ehcache-core.version}</version>
|
<version>${ehcache-core.version}</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.bytebuddy</groupId>
|
||||||
|
<artifactId>byte-buddy</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableAutoConfiguration
|
@EnableAutoConfiguration
|
||||||
@ComponentScan(basePackages = {"com.baeldung.voter"})
|
@ComponentScan(basePackages = {"com.baeldung.roles.voter"})
|
||||||
public class VoterApplication {
|
public class VoterApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
@ -12,6 +12,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
public class VoterMvcConfig implements WebMvcConfigurer {
|
public class VoterMvcConfig implements WebMvcConfigurer {
|
||||||
@Override
|
@Override
|
||||||
public void addViewControllers(ViewControllerRegistry registry) {
|
public void addViewControllers(ViewControllerRegistry registry) {
|
||||||
registry.addViewController("/").setViewName("private");
|
registry.addViewController("/private").setViewName("private");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
// @formatter: off
|
// @formatter: off
|
||||||
http
|
http
|
||||||
// needed so our login could work
|
// needed so our login could work
|
||||||
.csrf().disable().authorizeRequests().anyRequest().authenticated().accessDecisionManager(accessDecisionManager()).antMatchers("/").hasAnyRole("ROLE_ADMIN", "ROLE_USER").and().formLogin().permitAll().and().logout().permitAll()
|
.csrf().disable().authorizeRequests().anyRequest().authenticated().accessDecisionManager(accessDecisionManager()).and().formLogin().permitAll().and().logout().permitAll()
|
||||||
.deleteCookies("JSESSIONID").logoutSuccessUrl("/login");
|
.deleteCookies("JSESSIONID").logoutSuccessUrl("/login");
|
||||||
// @formatter: on
|
// @formatter: on
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue