Spring IOC control inversion

3, Control reversal By setting up a third-party container to decouple ABCD, they will not be unable to use all because of a certain collapse, and they realize independence; Inversion of Control (IoC for short), yes object-oriented programming A design principle in that can be used to reduce differences between computer codes Coupling degree . ...

Posted by mouli on Mon, 23 May 2022 09:15:53 +0300

Spring boot: single file upload / multiple file upload / multiple file fields upload in the form (spring boot 2.3.2)

1, How to realize the correspondence between the description and the file when there are multiple file fields in the form? 1. Description and document correspondence In the file upload page, if there are multiple file fields and multiple corresponding file descriptions, How do documents and instructions correspond? We can add the same number to ...

Posted by clodius on Mon, 23 May 2022 06:10:09 +0300

Spring Boot 2.x Basic Tutorial: Using Centralized Cache Redis

Earlier we introduced the usage of two in-process caches, including the default ones used by Spring Boot ConcurrentMap cache as well as Cache framework EhCache . Although EhCache can be applied to many application scenarios, since EhCache is an in-process caching framework, in cluster mode, the caches between each application server are indepen ...

Posted by cdrees on Mon, 23 May 2022 00:05:55 +0300

Adapter pattern -- Design Pattern

As the name suggests, adapters have to adapt to different current configurations and solve compatibility problems. Our life is full of all kinds of adapters. The modem used for Internet access is a kind of digital to analog conversion adapter, commonly known as "cat", but now it is all optical cat, that is, the mutual conversion of op ...

Posted by villas on Sun, 22 May 2022 13:37:03 +0300

Spring source code analysis -- SpringIOC

Spring source code analysis -- SpringIOC start In Spring, there are two configuration methods, one is xml version and the other is annotation version. They correspond to different ApplicationContext. The xml version is ClassPathXmlApplicationContext, while the annotation version is AnnotationConfigApplicationContext. // Start an ApplicationCo ...

Posted by aksival on Sun, 22 May 2022 12:19:47 +0300

spring boot data verification @ Valid @Validated

Check field // Check field @Valid @Validated yes@Valid One package of is Spring The provided verification mechanism is used.@Valid No grouping function is provided Configure global exception @Slf4j @ControllerAdvice public class GlobalExHandler { @ExceptionHandler(Exception.class) @ResponseBody public String error(Exception e) ...

Posted by cjbeck71081 on Sat, 21 May 2022 07:26:50 +0300

panda vernacular - Introduction to Spring AOP + actual combat

Spring two 🐮 Characteristics: IOC, AOP Interview must ask 😄 Basically, everyone has a deep understanding of IOC. Spring helps us manage bean s through the IOC container AOP is also widely used, but you haven't paid much attention to it Because it basically belongs to the framework level, you don't have to care about the basic configuration once ...

Posted by bimmer528 on Fri, 20 May 2022 22:19:13 +0300

Spring cloud learning -- Spring Cloud OpenFeign service call

1. Introduction 1.1 general Feign is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it. It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders. Spring Cloud adds support for Spring M ...

Posted by Someone789 on Fri, 20 May 2022 21:15:35 +0300

To understand the Volatile keyword, in fact, it is enough to read this article, which is very detailed

foreword volatile is a lightweight synchronization mechanism provided by the Java virtual machine. What is the role of the volatile keyword? Two functions: 1. Ensure that the shared variable modified by volatile is visible to the total number of threads, that is, when a thread modifies the value of a shared variable modified by volatile, the ne ...

Posted by c4onastick on Fri, 20 May 2022 19:43:48 +0300

Improve Spring Boot REST API error handling

introduction Spring Boot provides an excellent exception handling mechanism. The default implementation of ErrorController is good at catching and handling exceptions. In addition, you can also implement @ExceptionHandler yourself to catch and handle specific exceptions. However, there is room for improvement here: Even if a custom @Exceptio ...

Posted by MattWeet on Fri, 20 May 2022 18:31:37 +0300