This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
public class CustomErrorController implements ErrorController { | |
@RequestMapping("/error") | |
@ResponseBody | |
public String handleError(HttpServletRequest request) { | |
Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code"); | |
Exception exception = (Exception) request.getAttribute("javax.servlet.error.exception"); | |
return String.format("<html><body><h2>Sample Error Page</h2><div>Status code: <b>%s</b></div>" | |
+ "<div>Exception Message: <b>%s</b></div><body></html>", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
public class CommonErrorController implements ErrorController { | |
@Autowired private ErrorAttributes errorAttributes; | |
public void setErrorAttributes(ErrorAttributes errorAttributes) { | |
this.errorAttributes = errorAttributes; | |
} | |
@RequestMapping(value = "error") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExceptionResponse { | |
private Integer status; | |
private String path; | |
private String errorMessage; | |
private String timeStamp; | |
private String trace; | |
public ExceptionResponse(int status, Map<String, Object> errorAttributes) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First copy extracted JDK folder to /usr/lib/jvm. (JAVA 7, 8, 9, 10, 11 .tar.gz files) | |
cd /usr/lib/jvm | |
ls -al | |
lrwxrwxrwx 1 root root 25 Jan 28 2018 default-java -> java-1.11.0-openjdk-amd64 | |
lrwxrwxrwx 1 root root 21 Jan 28 2018 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64 | |
drwxr-xr-x 7 root root 4096 Jul 17 18:20 java-11-openjdk-amd64 | |
drwxrwxr-x 8 test test 4096 Aug 14 23:50 jdk-10.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM adoptopenjdk/openjdk8-openj9:latest | |
VOLUME /tmp | |
ARG JAR_FILE | |
COPY ${JAR_FILE} app.jar | |
ENTRYPOINT ["java","-Djava.security.egd+file:/dev/./urandom","-jar","app.jar"] | |
------------------------------------------------------------------------------ | |
FROM java:8 | |
VOLUME /tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// base case | |
if (root == nullptr) | |
{ | |
root = new TreapNode(data); | |
return; | |
} | |
// if given data is less than the root node, insert in the left subtree | |
// else insert in the right subtree | |
if (data < root->data) |
OlderNewer