Deploying Spring Boot Applications as WAR Files on External Tomcat

Configuring Maven for WAR Output Modify the build configuration to change the artifact type. Set the packaging element to war within the POM. <project> <groupId>com.example</groupId> <artifactId>enterprise-app</artifactId> <version>1.0.0</version> <packaging>war</packaging> ...

Posted on Tue, 30 Jun 2026 17:57:41 +0000 by snk

Spring Boot CORS Handling, Commons Lang3 Utility Guide, and Custom Startup Banner Configuration

Per-Controller CORS Setup Apply the @CrossOrigin annotation directly to a controller method or entire controller to enable cross-origin requests for specific endpoints: @RestController @RequestMapping("/system") public class SystemInfoController { @CrossOrigin @GetMapping("/current-time") public ServiceResponse ...

Posted on Mon, 29 Jun 2026 16:55:43 +0000 by Chrysanthus

Developing an AI-Powered Chatbot with Spring AI and Tencent CodeBuddy

Introduction to Spring AI for Chatbot Development Integrating artificial intelligence into applications is a growing trend, and frameworks like Spring AI simplify this processs for Spring Boot developers. Spring AI provides a robust, open-source solution for incorporating AI capabilities into Java-based applications, enabling features from auto ...

Posted on Mon, 29 Jun 2026 16:35:02 +0000 by jerbecca

Overview of the Spring Framework and Its Core Concepts

Spring Framework Overview Spring Framework is an open-source, lightweight Java development platform desgined to enhance development efficiency and system maintainability. It provides support for Inversion of Control (IoC) and Aspect-Oriented Programming (AOP), simplifies database access, integrates third-party components (email, scheduling, cac ...

Posted on Sun, 28 Jun 2026 18:13:11 +0000 by maGGot_H

Implementing Cross-Origin Policies, API Documentation, Exception Management, and JWT Authentication in Spring Boot

Understanding and Resolving Cross-Origin Requests Cross-Origin Resource Sharing (CORS) is triggered when a browser attempts to fetch resources from an origin differing in protocol, domain, or port from the current page. In decoupled frontend-backend architectures, this restriction enforced by the Same-Origin Policy requires explicit configurati ...

Posted on Sun, 28 Jun 2026 17:30:32 +0000 by akimm

Getting Started with Spring MVC, Spring Boot, and Deep Dive into Spring Session

Spring MVC Spring Controller Before diving into Spring controllers, let's look at a high-level view of what a Java web service does: A Spring controller has three key responsibilities: Bean configuration: applying controller annotations and managing beans Loading web resources: essentially serving web pages URL routing configuration: using th ...

Posted on Sun, 28 Jun 2026 17:25:29 +0000 by johnnyblaze1980

Configuring Database Connections in Spring Boot with MyBatis

Method 1: Using @Value for Property Injection Step 1: Define a properties file (e.g., jdbc.properties) jdbc.driverClassName=com.mysql.cj.jdbc.Driver jdbc.url=jdbc:mysql://127.0.0.1:3306/leyou jdbc.username=root jdbc.password=123456 Step 2: Create a configuration class using @Value package com.caicia.config; import com.alibaba.druid.pool.Druid ...

Posted on Sun, 28 Jun 2026 16:57:31 +0000 by shatteredroses

Dynamic Cron Expression Management in Spring Applications

In Spring Boot applications, we can enable scheduling support using the @EnableScheduling annotation and create scheduled tasks with the @Scheduled annotation. The @Scheduled annotation supports three configuration methods for execution timing: cron(expression): Executes based on a Cron expression. fixedDelay(period): Executes at fixed interva ...

Posted on Fri, 26 Jun 2026 16:11:50 +0000 by sword

Integrating RocketMQ with Spring Boot: A Deep Dive into Configuration and Source Code

Dependency Setup To begin, include the starter dependency in your Maven project: <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-spring-boot-starter</artifactId> <version>2.2.3</version> </dependency> This dependency triggers Spring Boot’s auto-configurati ...

Posted on Thu, 25 Jun 2026 16:36:30 +0000 by MnilinM

Implementing Efficient Excel Import/Export in Spring Boot with EasyExcel

Optimizing Excel Data Handling in Spring Boot Applications When dealing with Excel import/export functionality in Java web applications, memory efficiency becomes crucial. Traditional libraries like EasyPoi or Hutool can consume significant memory, making EasyExcel a better choice for large datasets. This implementation leverages Java 8 functio ...

Posted on Tue, 23 Jun 2026 17:31:45 +0000 by sangamon