Blog

In this lesson, you will learn how to read URL query string parameters in your Spring MVC web application.   @RequestParam annotation Let’s assume that we need to create a method that needs to return a list but is limited to a certain number. To make our method read URL Query String Parameters, we will…

Read More Spring Web MVC – Reading URL Query String Parameters

In this tutorial, you will learn how to pass information from your Controller class to the View using the Spring MVC ModelAndView object. In previous lessons, we discussed how to use Model and ModelMap for the same purpose – to pass properties from Controller to the View.  The ModelAndView class, you will also use to pass…

Read More Spring Web MVC – The ModelAndView Object

synchronized void method() {} public class SynchronizedInstanceMethodExample implements Runnable { public static void main(String[] args) { SynchronizedInstanceMethodExample runnable = new SynchronizedInstanceMethodExample(); new Thread(runnable).start(); // creates one thread new Thread(runnable).start(); // creates second thread } // Inherited run method from the Runnable interface @Override public void run() { try { // Calling the non-synchronized method print()…

Read More Java Synchronized Blocks and Methods

In this guide, you will learn to use @RepeatedTest and @ParametrizedTest annotations introduced in JUnit 5. We’ll look at the capability that lets us run a test a certain number of times.  We’ll also look at interfaces that will allow us to retrieve information about the repeated tests.  Moreover, we will also look at a…

Read More A Guide to @RepeatedTest and @ParametrizedTest in JUnit 5

In this tutorial, you will learn to configure your Spring Boot Web MVC application support Thymeleaf templates. Thymeleaf Maven Dependency To make your Spring Boot Web MVC application support Thymeleaf templates, you will need to add one additional dependency to the pom.xml file. <!– https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf –> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> Templates Folder In the Spring…

Read More Spring Web MVC – Configure Thymeleaf Support

class PrintArrayElementsExample { public static void main(String[] args) { int[] arr1 = {1, 7, 9, 5, 2, 8, 3}; String[] arr2 = {“Megan”, “Tom”, “Melissa”, “John”, “Steve”}; // print elements of the arr1 System.out.println(Arrays.toString(arr1)); // print elements of the arr2 System.out.println(Arrays.toString(arr2)); } } Output: [1, 7, 9, 5, 2, 8, 3] [Megan, Tom, Melissa, John,…

Read More Print Array Elements in Java

In this tutorial, you will learn how to configure the Spring Boot Web MVC application to support JSP(Java Server pages) and JSTL(JSP Standard Tag Library). Video Tutorial Maven Dependencies To configure your Spring Boot application to support Spring MVC, JSP and JSTL add the following maven dependencies to the pom.xml file. Spring Web The following…

Read More Spring Web MVC – Configure JSP Support

This tutorial is a high-level overview of the Spring Web MVC framework. Below is a high-level diagram of how things work in a Spring MVC Web application built with Spring Boot.    Most online tutorials or books will show you a similar diagram that is designed around the Dispatcher Servlet. Because this Dispatcher servlet is…

Read More Spring Web MVC – Overview for Beginners

public class SplitString { public static void main(String[] args) { String names = “Tom,Steve,John,Megan,Melissa”; // split string String[] arr = names.split(“,”); // print the size of the array System.out.println(arr.length); // print the elements Stream.of(arr).forEach(System.out::println); } } Output: 5 Tom Steve John Megan Melissa   If you need a list, instead of an array, use the…

Read More Split a comma-separated String in Java

In this tutorial, you will learn how to secure access to User’s Data in RDS using Lambda Authorizer. First, the Lambda Authorizer function will authenticate the caller by validating JWT using nimbus-jose-jwt library. After that, the Lambda Authorizer function will return an output object containing an IAM policy. The Authorizer will also return additional information…

Read More Lambda Authorizer – Secure Access to User’s Data in RDS