Currying in Java
1. Introduction Since Java 8, we can define one- and two-parameter functions in Java, allowing us to inject their behaviors into other functions, by passing them in as parameters. But for functions...
View ArticleJava Weekly, Issue 272
Here we go… 1. Spring and Java >> Memory footprint of the JVM [spring.io] A nice write-up on heap vs non-heap memory, native memory areas, challenges of sizing the JVM, and how Spring minimizes...
View ArticleHow to Return 404 with Spring WebFlux
1. Overview With Spring Boot 2 and the new non-blocking server Netty, we don’t have the Servlet context API anymore, so let’s discuss the way how we can express different kind of HTTP status codes,...
View ArticleMaking a JSON POST Request With HttpURLConnection
1. Overview In this tutorial, we’ll demonstrate how to make a JSON POST request using HttpURLConnection. 2. Building a JSON POST Request with HttpURLConnection 2.1. Create A URL Object Let’s create a...
View ArticleUsing @Autowired in Abstract Classes
1. Introduction In this quick tutorial, we’ll explain how to use the @Autowired annotation in abstract classes. We’ll apply @Autowired to an abstract class, and focus on the important points which we...
View ArticleMethod Inlining in the JVM
1. Introduction In this tutorial, we’ll take a look at what method inlining is in the Java Virtual Machine and how it works. We’ll also see how to get and read the information related to inlining from...
View ArticleRxJava Hooks
1. Overview In this tutorial, we’re going to learn about RxJava hooks. We’ll be creating short examples to demonstrate how the hooks work in different situations. 2. What are RxJava Hooks? As the name...
View ArticleCreating a Kotlin Range Iterator on a Custom Object
1. Introduction In a previous article, we showed how we can create a range in Kotlin, and how easy it is to iterate over Int, Long and Char types. But what if we want to iterate over a custom type? Is...
View ArticleA Java Web Application Without a web.xml
1. Overview In this tutorial, we’re creating a Java web application using Servlet 3.0+. We’ll take a look at three annotations – @WebServlet, @WebFilter, and @WebListener – that can help us nix our...
View ArticleGetting and Verifying Response Data with REST-assured
1. Overview In this tutorial, we’ll discuss how to test REST services using REST-assured, with a focus on capturing and validating the response data from our REST APIs. 2. Setup for the Test Class In...
View ArticleSpring Boot with Hibernate
1. Overview In this article, we’ll have a look at how to use Spring Boot with Hibernate. We’ll build a simple Spring Boot application and see how easy it is to integrate it with Hibernate. 2....
View ArticleHow to Fix java.lang.UnsupportedClassVersionError
1. Introduction In this short tutorial, we’re going to learn what causes the Java runtime error java.lang.UnsupportedClassVersionError: Unsupported major.minor version and how to fix it. 2. A Look at...
View ArticleIntroduction to Project Amber
1. What is Project Amber Project Amber is a current initiative from the developers of Java and OpenJDK, aiming to deliver some small but essential changes to the JDK to make the development process...
View ArticleJava Weekly, Issue 273
Here we go… 1. Spring and Java >> Use DataDog to monitor and troubleshoot your Java web applications Optimize performance with end-to-end tracing and out-of-the-box support for most Java...
View ArticleKotlin Scope Functions
1. Overview Scope functions are very useful, and we use them frequently in Kotlin code. In this tutorial, we’ll explain what they are and also provide some examples of when to use each one. 2. also...
View ArticleSpring Boot Consuming and Producing JSON
1. Overview In this tutorial, we’ll show how to build a REST service to consume and produce JSON content with Spring Boot. We’ll also take a look at how we can easily employ RESTful HTTP semantics. For...
View ArticleKotlin Annotations
1. Overview In this tutorial, we’ll give an overview of Kotlin annotations. We’ll demonstrate how to apply them, how to create and customize our own ones. We’ll then briefly discuss the interplay...
View ArticleSpring Boot Reactor Netty Configuration
1. Overview In this tutorial, we’re going to look at different configuration options for a Reactor Netty server in a Spring Boot application. In the end, we’ll have an application showcasing different...
View ArticleTransactionRequiredException Error
1. Overview In this tutorial, we’re going to examine the cause of the TransactionRequiredException error and how to solve it. 2. TransactionRequiredException This error typically occurs when we’re...
View ArticleConverting Between LocalDate and XMLGregorianCalendar
1. Overview In this quick tutorial, we’ll discuss LocalDate and XMLGregorianCalendar and provide examples of converting between the two types. 2. XMLGregorianCalendar The XML Schema standard defines...
View Article