Upgrade Boot-based samples to Spring Boot 2.0.0.M6
Closes gh-444
This commit is contained in:
@@ -3,7 +3,7 @@ buildscript {
|
||||
maven { url 'https://repo.spring.io/milestone' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M1'
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M6'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.M1</version>
|
||||
<version>2.0.0.M6</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ buildscript {
|
||||
maven { url 'https://repo.spring.io/milestone' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M1'
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M6'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,19 +18,20 @@ package com.example.notes;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.autoconfigure.web.servlet.error.DefaultErrorAttributes;
|
||||
import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
|
||||
@Component
|
||||
class ExceptionSupressingErrorAttributes extends DefaultErrorAttributes {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getErrorAttributes(RequestAttributes requestAttributes,
|
||||
public Map<String, Object> getErrorAttributes(WebRequest webRequest,
|
||||
boolean includeStackTrace) {
|
||||
Map<String, Object> errorAttributes = super.getErrorAttributes(requestAttributes, includeStackTrace);
|
||||
Map<String, Object> errorAttributes = super.getErrorAttributes(webRequest, includeStackTrace);
|
||||
errorAttributes.remove("exception");
|
||||
Object message = requestAttributes.getAttribute("javax.servlet.error.message", RequestAttributes.SCOPE_REQUEST);
|
||||
Object message = webRequest.getAttribute("javax.servlet.error.message", RequestAttributes.SCOPE_REQUEST);
|
||||
if (message != null) {
|
||||
errorAttributes.put("message", message);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ buildscript {
|
||||
maven { url 'https://repo.spring.io/milestone' }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M1'
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M6'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user