Java67
Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Saturday, May 27, 2023
Aggregator Design Pattern In Java Microservices with Examples
What is Circuit Breaker Design Pattern in Microservices? How to implement it?
Friday, May 26, 2023
How to find Kth Smallest Element in a Binary Search Tree? [Solved]
How to find the maximum sum level in binary tree in Java? Example Tutorial
Thursday, May 25, 2023
Difference between application.properties vs Application.json vs Application.yml in Spring Boot
Difference between @RequestParam vs @RequestBody in Spring MVC? (with Example)
Difference between Spring Boot vs Spring Cloud in Java
Hello guys, if you are wondering, what is difference between Spring Boot and Spring Cloud then you re not alone. Many Java developer are not familiar with various spring boot projects like Spring Security, Spring Data JPA, Spring Batch, Spring Boot, Spring Cloud etc and this lack of knowledge prevent them from taking full advantage of Spring Framework. In last article, I have explained difference between Spring framework and Spring Boot and in this article we are going to discuss the difference between Spring Boot and Spring Cloud. Before we dive into the difference between the two terms. Let us take a look at different terms like Spring, Spring Boot, and Spring Cloud.
Wednesday, May 24, 2023
10 Examples of RestTemplate in Spring Framework
How to Handle REST exception in Spring Boot Application? Example Tutorial
Hello everyone, in this article we are going to take a look at how to handle REST API exceptions in Spring Boot. It is crucial to handle errors correctly in APIs by displaying meaningful messages as it helps API clients to address problems easily. What happens if we don’t handle the errors manually? By default, the spring application throws a stack trace, which is difficult to understand. Stack traces are mainly for developers hence it is useless for API clients. That's why its very important to use proper HTTP code and error messages to convey errors and exception to client and also logging so that support team can better handle them. Ideally you should tell what went wrong and how to fix it? For example, if the error is due to duplicate data then clearly say, already existed, try with a new one. Similarly, if authentication fail then clearly say authentication failed instead of throwing some other exception.