Administrator

Lokesh Gupta

Lokesh Gupta is a Java developer with more than 20 years of experience and the founder of HowToDoInJava, which he started in 2012. He has worked on Java and Spring applications at Hewitt Associates, Hughes Systique, Adobe and Bank of America. The site has over 1,600 tutorials on Java, Spring Boot, Hibernate, testing and TypeScript. Every example is run and verified before it is published, and the source code is on GitHub.

Website: https://howtodoinjava.com

Github: https://github.com/lokeshgupta1981/

Twitter: @HowToDoInJAVA

LinkedIn: https://www.linkedin.com/in/lokeshgupta1981/

My Articles:

Spring ProblemDetail and ErrorResponse

Starting since Spring 6 and Spring Boot 3, the Spring Framework supports the “Problem Details for HTTP APIs” specification, RFC 7807. This Spring tutorial will guide you through this new enhancement in detail. 1. Problem Details Specification [RFC 7807] This RFC defines simple JSON and XML document formats that can …

Spring @Lookup Method Injection

Spring lookup method injection is the container’s ability to override methods on container-managed beans and return another container-managed bean.

Spring: Injecting Prototype Bean into Singleton Bean

Spring context supports singleton and prototype bean scopes along with four other scopes specific to the web context. The singleton is the default bean scope. A common problem arises when we want to inject a prototype-scoped bean into a singleton-scoped bean. In this case, as the singleton bean is initialized …

Springdoc OpenAPI: Swagger UI for Spring Boot REST APIs

Springdoc OpenAPI generates the OpenAPI 3 document and the Swagger UI page for a Spring Boot REST API from one starter dependency. Default URLs, springdoc.* properties, Swagger annotations, groups, security scheme and how to switch the docs off in production.

Spring Framework Tutorials

Spring helps write high-performing, easily testable, and reusable code and promotes programming best practices by applying dependency injection (DI).

Spring MVC

Spring WebMVC (or Spring MVC) contains Spring’s model-view-controller (MVC) and REST Web Services implementation for web applications.

Spring Batch Tutorial

Spring batch is a lightweight, comprehensive framework designed for the development of robust batch processing applications. Learn with examples.

What’s New in Spring 6 and Spring Boot 3

Learn about the new features and changes introduced in Spring 6 and Spring boot 3 such as baseline upgrade to Java 17 and removing all deprecated classes, methods and properties.

Java String & Regex Tutorials

Java String methods grouped by task with Java 25 examples, from equals() and compareTo() to strip(), split() and replaceAll(), with pitfalls and FAQs.

Spring Boot Filter: with Order and URL Pattern Examples

In this Spring boot tutorial, we will learn to create, order and register servlet filters in different ways including Filter interface, @WebFilter annotation and inbuilt filter bean classes. 1. Introduction In a web application, we must implement the javax.servlet.Filter interface (jakarta.servlet.Filter in Spring Boot 3) to create filters that can …

Build Tools: Maven & Gradle

Maven is a build tool based on POM and is generally used for Java projects to automatically download the project dependencies in build time.

Running JUnit Tests with Maven

Learn to run JUnit tests using Maven Surefire Plugin. We will learn to run a single test, run only selected tests or run all the tests in the project.

JavaScript Check if Variable is a Number (and NaN Traps)

Number.isFinite() is the reliable way to check if a variable is a number in JavaScript. Learn why typeof and the global isNaN() let bad values through, how to validate numeric strings from forms, and how to write a TypeScript type guard.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.