Spring Boot CRUD Application with Thymeleaf and JPA
Build a Spring Boot 4.1.2 CRUD application with Thymeleaf, Spring Data JPA, validation, H2, and tested create, edit, and delete flows.
Build a Spring Boot 4.1.2 CRUD application with Thymeleaf, Spring Data JPA, validation, H2, and tested create, edit, and delete flows.
Learn to request partial data from the database using pagination and sorting inputs using the query parameters in spring boot and data apps.
Learn to build a robust Spring Boot application with Hibernate, covering CRUD operations, paging, filtering, caching, and best practices.
Configure Hibernate with Spring Boot 4.1.2 and Spring Data JPA. Verify the configured H2 datasource, schema behavior, repository operations and SQL logging.
Configure Spring Boot 4.1.2 embedded Tomcat with tested examples for port, bind address, access logs, HTTPS, and a server customizer.
Learn to configure Spring boot with H2 database to create and use an in-memory database in runtime, generally for unit testing or POC purposes.
Learn to enable and customize the internal and access logs generated for embedded servers in Spring boot e.g. tomcat, jetty & undertow.
Java DelayQueue explained with a Delayed record, take(), poll() and peek() rules, a producer-consumer order timeout example and the alternatives.
Shut down a Java ExecutorService with shutdown(), awaitTermination() and shutdownNow(), or with try-with-resources and close() on Java 19+. Covers queued tasks, RejectedExecutionException, virtual threads, JVM exit and shutdown hooks.
Learn to cancel a task in ExecutorService with Future.cancel(), stop running tasks with interrupts, cancel after a timeout and clean up with purge().
Java ScheduledExecutorService examples for delayed and periodic tasks, scheduleAtFixedRate vs scheduleWithFixedDelay, exceptions, cancel and daily jobs.
Learn how ExecutorService invokeAll() runs a batch of Callable tasks, with timeouts, failed tasks, Future.state() and invokeAny() for the first result.
A RejectedExecutionHandler decides what happens to a task that a ThreadPoolExecutor cannot accept. Compare the four built-in policies with real output and write custom handlers.
Learn ExecutorService in Java with Java 25 examples for submit(), invokeAll(), Future results, close() with try-with-resources and virtual threads.
Compact number formatting in Java with CompactNumberFormat. Format 1000 as 1K or 1 thousand, control decimals and rounding, parse values and use locales.
Java String isBlank() checks if a string is empty or only whitespace. See isBlank() vs isEmpty() and trim(), null-safe checks, Unicode cases and FAQs.
Repeat a string N times in Java with String.repeat(), StringBuilder.repeat(), String.join() with nCopies, Java 8 loops and StringUtils, with edge cases.
Collectors teeing() runs two collectors in one stream pass and merges the results. Examples for min and max, filter and count, records and nesting.
Check a deficient number in Java with a loop or the faster square-root method, compute the deficiency, and classify perfect and abundant numbers.
Check a pronic number in Java with a loop, the square root or the 4x+1 test, handle long values safely, and generate the n(n+1) sequence.
Check a Harshad number in Java with a digit-sum loop that never divides by zero, try other bases, count Harshad numbers and build a lucky-draw rule.
Check a happy number in Java with a HashSet, Floyd cycle detection or the stop-at-4 shortcut, and see why every unhappy number reaches the same cycle.
Check a disarium number in Java with exact integer math, see why 89, 135 and 518 qualify, list all 20 of them and compare them with Armstrong numbers.
Learn to read Spring Boot command-line arguments with ApplicationArguments, validate options, and override configuration properties with a runnable example.
Return 403 access denied response in jSON in REST API where principal should be pre-authenticated but is null in AbstractPreAuthenticatedProcessingFilter.
Learn to handle the HTTP OPTIONS requests specific to REST resource in Spring WebMVC applications by adding handler methods.
Learn how Spring Boot checks the JSON body, path variables and query parameters of a REST request. See which exception Spring throws, how to return clear field errors, and how to validate nested objects and lists, use groups, write a custom rule and test with MockMvc on Spring Boot 4.1.1.
Learn to add custom token based authentication to REST APIs using created with Spring REST and Spring security 5. In given example, a request with header name “AUTH_API_KEY” with a predefined value will pass through. All other requests will return HTTP 403 response.
Compare LocalDateTime in Java with isBefore(), isAfter(), isEqual() and compareTo(), ignore seconds with truncatedTo() and handle values from other zones.
Learn to handle exceptions locally and globally in Spring Boot REST APIs using @ControllerAdvice, @ExceptionHandler, and other latest approaches.
Learn to create REST APIs for crud operations using Spring REST and JPA configuration (H2 database as backend) without Spring boot auto configuration feature.
Compare LocalDate values in Java with isBefore(), isAfter(), isEqual(), equals() and compareTo(), with the values compareTo() returns and a booking check.
Learn to execute the cURL commands from Windows. Beginning in Insider Build 17063, Tar and curl are available from the command-line for all SKUs of Windows.
Build OAuth2 authorization and resource servers with Spring Boot 4.1.2. Run client credentials and PKCE flows, validate JWTs, and compare 401 and 403 responses.
AtomicInteger lets many threads update one int without a lock. Covers every method with results, compare-and-swap, AtomicInteger vs synchronized vs volatile, and LongAdder for high contention.
Show time in Java 12-hour format with AM/PM using the pattern letters h and a, fix pm vs PM locale output, and convert between 12 and 24 hours.
Java examples to format a LocalDate to String with toString(), DateTimeFormatter.ofPattern(), the ISO constants and localized FormatStyle with Locale, and to parse the String back.
Check leap year in Java with Year.isLeap() and LocalDate.isLeapYear(), learn the 4, 100 and 400 rule, and handle February 29 in date math.
Compare ZonedDateTime in Java by instant with isEqual(), see why equals() and compareTo() differ across zones, and handle DST gaps and overlaps.
Format ZonedDateTime to String in Java with ISO constants, zone letters z, VV and XXX, localized styles, and the same moment shown in other time zones.
Convert LocalDate to ZonedDateTime in Java with atStartOfDay(zone) or atTime().atZone(), and back with toLocalDate(), including DST days and zone pitfalls.
Convert LocalDate to LocalDateTime in Java with atStartOfDay() and atTime(), and back with toLocalDate(), plus zone-aware day starts and day ranges.
Parse String to ZonedDateTime in Java with ISO text, VV and XXX patterns, ambiguous names like PST or IST, and strings that have no time zone.
Convert a string to LocalDateTime with LocalDateTime.parse() and DateTimeFormatter. Learn the ISO format, pattern letters, AM/PM and Locale, strings with a zone, date-only strings, strict parsing and common error messages.
Convert String to LocalDate in Java with LocalDate.parse(), custom patterns, month names in any locale and safe DateTimeParseException handling.
Java ZonedDateTime examples on Java 25. Create, parse and format zoned date-times, handle DST gaps and overlaps, and convert a time between zones.
Java LocalDateTime examples on Java 25. Create, parse and format date-times, add hours, compare values and convert to ZonedDateTime without DST surprises.
Java LocalTime examples on Java 25. Create, parse and format times, add hours across midnight, check opening hours and measure the time between two times.
Java LocalDate examples on Java 25. Create, parse and format dates, add days and months, compare dates and convert LocalDate to other date types.
Java stream filter with multiple conditions using && and ||, chained filter() calls and Predicate and(), or(), negate(), plus dynamic search filters.
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.