catalogue
1, Interceptor configuration
2, Execution sequence of multiple interceptors
3, Exception handling based on configuration file
4, Annotation based exception handling
1, Interceptor configuration
1. Interceptors in springmvc are used to intercept the execution of controller methods
2. Interceptors in springmvc need to implem ...
Posted by darksystem on Fri, 05 Aug 2022 21:42:54 +0300
File download is to download files from the file server to the local. In spring MVC, there are two steps to download files:
Step 1: use a file download hyperlink on the client. The href attribute in the link points to the method and file name of downloading the file in the background;
Step 2: in the background controller class, use the file dow ...
Posted by timbolt on Wed, 25 May 2022 23:22:36 +0300
1. Annotation
It can be seen from the literal meaning that the function of this is to initialize the Binder, and the method annotated by this can initialize the WebDataBinder. webDataBinder is for form to method data binding!
@InitBinder only annotates methods in @Controller to register a binder initialization method for this controller, and t ...
Posted by microthick on Wed, 18 May 2022 13:04:15 +0300
In addition to caching, Redis can also do many things: distributed locking, flow limiting, idempotency of request processing interface... Too much, too much ~Today, I want to talk with my friends about how to use Redis to deal with interface current limitation. This is also the knowledge point involved in the recent TienChin project. I'll bring ...
Posted by harley1387 on Tue, 17 May 2022 16:48:56 +0300
Exception handling can be either front-end or back-end.
From a safe point of view, both sides should be dealt with.
This paper focuses on how to handle http request exceptions on the server.
1, Common exception types
When we make an http request, there will be various possible errors, such as:
1. Service exceptions
2. The interface is abnormal, ...
Posted by flappy_warbucks on Mon, 16 May 2022 16:24:46 +0300
summary
I remember when I was debugging the interface with my front-end colleagues, the back-end spring MVC needed to receive the parameters of the array type, and then told the front-end that it needed to pass the array type. Later, the front-end children's shoes passed the array, but the back-end reception was unsuccessful and the joint debu ...
Posted by elum.chaitu on Sun, 15 May 2022 23:11:01 +0300
1. Concept
The Interceptor of Spring MVC is similar to the Filter of Java Servlet. It is mainly used to intercept users' requests and handle them accordingly. It is usually used in functions such as permission verification, logging request information, judging whether users log in or not.
Defining an interceptor in the Spring MVC framework ...
Integrated thinking
Step 1: build an integrated environment Step 2: build a Spring development environment Step 3: integrate Spring MVC with Spring Step 4: integrate Mybatis with Spring We first configure each framework to ensure that each framework can be executed separately, and then carry out the integration operation.
Integrated environme ...
Posted by eyegraphix on Tue, 10 May 2022 12:13:18 +0300
Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it
Data processing and jump
ModelAndView
Set the ModelAndView object and jump to the specified page according to the name of the view and the view parser
Page: {view parser prefix} + viewN ...
Posted by girlzz on Fri, 06 May 2022 10:48:34 +0300
This series of documents is summarized in the process of learning the source code of Spring MVC. It may not be very friendly to readers. Please combine my source code comments Spring MVC source code analysis GitHub address Read
Spring version: 5.2.4 RELEASE
With the popularity of Spring Boot and Spring Cloud in many large and medium-sized ente ...
Posted by sarun on Sun, 01 May 2022 22:30:54 +0300