Skip to main content

Java

Creating Spring Beans with Static Factory Methods

Learn how to create Spring beans using static factory methods with @Bean configuration and XML. Covers third-party class registration, profile-based implementations, construction-time validation, and JUnit testing.

Top 40 Spring MVC Interview Questions and Answers (2025)

Prepare for your Java interview with the top 40 Spring MVC interview questions and answers covering DispatcherServlet, annotations, REST, validation, exception handling, and more — from beginner to advanced.

How to Use Jersey Client to Call REST Services in Java

A complete guide to consuming REST APIs with the Jersey Client API: GET, POST, PUT, DELETE requests, JSON handling, query parameters, headers, authentication, and error handling — with annotated Java code and sample output.

Mastering Cache Control with ETag in Spring Boot RESTful APIs

ETag cache control in a Spring Boot REST API, re-verified on Spring Boot 4.1.1 and Spring Framework 7.0.9: the zero-code ShallowEtagHeaderFilter, deep caching with WebRequest.checkNotModified(), conditional PUT with If-Match, and strong vs weak ETags.

Mastering Conversions Between Java LocalDate and ZonedDateTime

Learn how to convert LocalDate to ZonedDateTime in Java and back: atStartOfDay(), atTime(), UTC conversion, DST-safe patterns, and a real-world date-range query example across timezones — with annotated code and a quick-reference table.

Java: Converting LocalDateTime to ZonedDateTime Correctly

Learn every way to convert LocalDateTime to ZonedDateTime in Java: atZone(), atOffset(), UTC conversion, DST gap and overlap handling, and reverse conversion back to LocalDateTime — with annotated code and a complete reference table.

Jersey REST API – Complete File Upload and Download Example

Build a complete file-upload REST endpoint with Jersey 3.x: single file, multiple files, HTML form testing, curl commands, file-size limits, and a download endpoint. Includes production-hardening tips for cloud storage and MIME validation.

Mastering Maven: How to Create Your Own Custom Archetypes

Build a custom Maven archetype from scratch: create the descriptor, add Velocity-templated source files, install locally, generate a new Spring Boot project from it, and deploy to a team-shared repository. Step-by-step with working code.