How to Configure MyBatis with Spring Boot
Learn to configure MyBatis with Spring Boot 3 and configure @Mapper and DataSource. Also, learn mapper scanning with @MapperScan with example.
Learn to configure MyBatis with Spring Boot 3 and configure @Mapper and DataSource. Also, learn mapper scanning with @MapperScan with example.
Learn to use the Spring @HttpExchange to create and configure a declarative HTTP client interface (blocking/non-blocking) with examples.
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 …
This JHipster tutorial will familiarize you with this popular code generation platform and work with front-end and backend generated code.
Remove items from a TypeScript array by position or by value, in place or on a copy, with the common bugs (-1 index, splice in a loop, delete) shown and fixed.
Add items to the end, start or any index of a TypeScript array, or to a new array with spread, concat() and toSpliced(), with the compiler errors explained.
Get the current date in TypeScript, create dates, add days and months, compare and format them, and avoid the time zone and JSON pitfalls of the Date object.
Java ArrayDeque tutorial with stack and queue examples, both-end methods, Java 21 reversed(), iteration, an undo history and ArrayDeque vs LinkedList.
Learn the JMH Java Microbenchmark Harness with the Maven archetype, the Java 23+ processor fix, @State, @Param, Blackhole, real results and pitfalls.
Spring lookup method injection is the container’s ability to override methods on container-managed beans and return another container-managed 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 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.
The full list of Java keywords as of Java 25, with 51 reserved and 17 contextual keywords grouped by category, literals, version history and rules.
Java IO tutorial for Java 25 covering Path and Files, byte and character streams, NIO channels, how IO works in the OS, and every file task by topic.
Java SynchronousQueue explained with put(), take(), offer() and poll() examples, a producer-consumer handoff, thread pool use and the alternatives.
Spring helps write high-performing, easily testable, and reusable code and promotes programming best practices by applying dependency injection (DI).
Spring WebMVC (or Spring MVC) contains Spring’s model-view-controller (MVC) and REST Web Services implementation for web applications.
Spring batch is a lightweight, comprehensive framework designed for the development of robust batch processing applications. Learn with examples.
Java Queue interface guide with the six methods, how to choose ArrayDeque, PriorityQueue or a BlockingQueue, iteration, BFS and thread-safe queues.
Read and configure the JUnit XML report from Maven Surefire and Gradle, enable Open Test Reporting XML in JUnit 6, show display names and publish in CI.
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 methods grouped by task with Java 25 examples, from equals() and compareTo() to strip(), split() and replaceAll(), with pitfalls and FAQs.
Find a file in a directory and its subdirectories in Java with Files.find(), Files.walk() and walkFileTree(), with depth limits and globs.
Java stream groupingBy() examples that group a list by one or more fields and count, sum, average or sort each group with downstream collectors.
Learn to read a text file stored in AWS S3 bucket. We will learn to read a public file or non-public file using the access/secret keys.
Learn to configure log4j2 DynamicThresholdFilter and how to match thresholds and write the filtered messages using various combinations.
Learn to filter the logging messages or events using the Log4j2 MarkerFilter, create instances, and configure them in log4j2.xml.
Convert a map to a list, array or set in Java using keySet(), values() and entrySet(), with streams, toArray(), ordering rules and lists of records.
Fix the IllegalStateException stream has already been operated upon or closed in Java. See why streams are single-use and three ways to reuse the data.
How to handle InterruptedException in Java correctly. Propagate it or restore the interrupt flag, avoid common mistakes, and cancel executor tasks.
Semaphore vs ReentrantLock in Java compared with a table and code for ownership, reentrancy, IllegalMonitorStateException, conditions and when to use each.
Learn to flatten a list of lists in Java with flatMap(), addAll() loops, mapMulti(), recursion for deep nesting, Guava and Eclipse Collections.
Choose Java, Spring, SQL, coding and best-practice interview guides for your role, then practice explaining answers with examples and project decisions.
Convert List to Map in Java with Collectors.toMap() and groupingBy(), fix the duplicate key IllegalStateException with a merge function, keep order.
Learn to iterate over a stream with indices in Java using IntStream.range(), a record, a Java 24 gatherer, AtomicInteger, Guava and StreamEx.
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 …
Maven is a build tool based on POM and is generally used for Java projects to automatically download the project dependencies in build time.
Learn to remove or update list elements using streams in Java with filter() and map(), or in place with removeIf() and replaceAll(), using records.
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.
Arrays.asList() vs new ArrayList() in Java explained with examples, covering fixed size, the shared array, List.of(), primitive arrays and conversions.
Convert an object to Map in Java with Jackson 3 convertValue(), JavaPropsMapper flat keys, Gson and reflection, plus nulls, records and Map back to object.
Fix the Jackson error “Java 8 date/time type not supported by default” for LocalDate, LocalDateTime and Instant by registering JavaTimeModule, with the Spring Boot and Jackson 3 cases and the output format settings.
Learn to filter a map by a list of keys in Java with get() lookups, streams and retainAll(), keep the key order and report the keys that are missing.
All TypeScript tutorials on howtodoinjava.com, grouped by topic: basics, types, operators, arrays, collections, functions, interfaces and classes.
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.
IllegalMonitorStateException in Java explained, with every cause from wait() and notify() outside synchronized to ReentrantLock unlock() and the fixes.
Learn how to round a double to 2 decimal places in Java with BigDecimal, Math.round(), String.format() and DecimalFormat, plus rounding modes and pitfalls.
Invert a map in Java by swapping keys and values with a loop or Collectors.toMap(), handle duplicate values with groupingBy(), and use Guava BiMap.
Java printf examples for %s, %d, %.2f, width, flags, dates and locales, plus String.format(), formatted() and fixes for common format exceptions.
Learn about Spring Boot Actuator and adding custom static and dynamic information to the /info endpoint using properties and InfoContributor.
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.