Merge pull request #10437 from rozagerardo/rozagerardo/JAVA-3721_Update-articles-for-2.4.0--articles-using-profiles-2

[JAVA-3721] Update articles for 2.4.0 - modules using spring.profiles.* properties - part 2
This commit is contained in:
Loredana Crusoveanu 2021-01-21 10:21:32 +02:00 committed by GitHub
commit 26c646f6fc
2 changed files with 18 additions and 7 deletions

View File

@ -58,6 +58,17 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>

View File

@ -1,16 +1,16 @@
package com.baeldung.loginredirect;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.http.HttpStatus;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.util.UrlPathHelper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
class LoginPageInterceptor extends HandlerInterceptorAdapter {
class LoginPageInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {