Skip to content

Commit

Permalink
Spring Boot 2.4.1 update
Browse files Browse the repository at this point in the history
  • Loading branch information
naturalprogrammer committed Dec 19, 2020
1 parent 0dbc8cf commit 577ac39
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<version>2.4.1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.naturalprogrammer.spring.lemon.commons.LemonCommonsAutoConfiguration;
import com.naturalprogrammer.spring.lemon.commons.LemonProperties;
import com.naturalprogrammer.spring.lemon.commons.exceptions.handlers.BadCredentialsExceptionHandler;
import com.naturalprogrammer.spring.lemon.commonsweb.exceptions.DefaultExceptionHandlerControllerAdvice;
import com.naturalprogrammer.spring.lemon.commonsweb.exceptions.LemonErrorAttributes;
import com.naturalprogrammer.spring.lemon.commonsweb.exceptions.LemonErrorController;
import com.naturalprogrammer.spring.lemon.commonsweb.exceptions.handlers.MissingPathVariableExceptionHandler;
import com.naturalprogrammer.spring.lemon.commonsweb.security.LemonCorsConfigurationSource;
import com.naturalprogrammer.spring.lemon.commonsweb.security.LemonWebAuditorAware;
import com.naturalprogrammer.spring.lemon.commonsweb.security.LemonWebSecurityConfig;
Expand All @@ -26,6 +28,7 @@
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
Expand All @@ -39,6 +42,7 @@
@Configuration
@EnableSpringDataWebSupport
@EnableGlobalMethodSecurity(prePostEnabled = true)
@ComponentScan(basePackageClasses= MissingPathVariableExceptionHandler.class)
@AutoConfigureBefore({
WebMvcAutoConfiguration.class,
ErrorMvcAutoConfiguration.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.naturalprogrammer.spring.lemon.commonsweb.exceptions.handlers;

import com.naturalprogrammer.spring.lemon.exceptions.LemonFieldError;
import com.naturalprogrammer.spring.lemon.exceptions.MultiErrorException;
import com.naturalprogrammer.spring.lemon.exceptions.handlers.AbstractExceptionHandler;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.MissingPathVariableException;

import java.util.Collection;

@Component
@Order(Ordered.LOWEST_PRECEDENCE)
public class MissingPathVariableExceptionHandler extends AbstractExceptionHandler<MissingPathVariableException> {

public MissingPathVariableExceptionHandler() {

super(MissingPathVariableException.class);
log.info("Created");
}

@Override
public HttpStatus getStatus(MissingPathVariableException ex) {
return HttpStatus.NOT_FOUND;
}
}
2 changes: 1 addition & 1 deletion spring-lemon-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-patch</artifactId>
<version>RELEASE</version>
<version>1.9</version>
</dependency>

<!-- For generating Auto Completion of lemon.* in application.properties
Expand Down
2 changes: 1 addition & 1 deletion spring-lemon-exceptions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>RELEASE</version>
<version>3.11</version>
</dependency>

</dependencies>
Expand Down

0 comments on commit 577ac39

Please sign in to comment.