Spring MVC explains the core technology in detail
Chapter IV spring MVC core technology
1. Forwarding and redirection
forward: view full path
redirect: view full path
1.1 java code
@Controller
public class MyController {
* The controller method returns MOdelAndView Realize forwarding forward
* grammar: mv.setViewName("forward:View full path")
*
* forward Features ...
Posted by vargefaret on Fri, 12 Nov 2021 16:35:12 -0800
Spring MVC exception handling
Spring MVC has three ways to handle exceptions:
Use the simple exception handler SimpleMappingExceptionResolver provided by Spring MVC.Implement the exception handling interface HandlerExceptionResolver of Spring and customize your own exception handler.Use the @ ExceptionHandler annotation to implement exception handling
1. @ExceptionHandler ...
Posted by rigi2 on Tue, 26 Oct 2021 19:20:24 -0700
Spring MVC learning notes
1. Review MVC
1.1 what is MVC
MVC is the abbreviation of model, view and controller. It is a software design specification. It is a method to organize code by separating business logic, data and display. The main function of MVC is to reduce the two-way coupling between view and business logic. MVC is not a design pattern, MVC is an archi ...
Posted by sturoy on Sat, 23 Oct 2021 22:21:09 -0700
About backend processor - HandlerMethod
catalogue
preface
HandlerMethod
ServletInvocableHandlerMethod
InvocableHandlerMethod
summary
preface
Through the previous article, we know the general process of Spring MVC executing the Controller method. The important step is to find the appropriate back-end processor (handler) to execute the target method ...
Posted by rathersurf on Fri, 15 Oct 2021 17:42:03 -0700
JSON-Initial Knowledge+Resolution
1. JSON
1.1 What is JSON
JSON (JavaScript Object Notation) is a lightweight data exchange format. JSON uses JavaScript syntax to describe data objects, uses a language-independent text format, and is easy to store and exchange.
The network media type of JSON is application/json.
1.2 JSON Scope of Use
JSON writes data objects based on ...
Posted by terfle on Thu, 14 Oct 2021 09:51:14 -0700
Data response of Spring MVC
4. Data response of spring MVC
4.1 data response mode of spring MVC
1) Page Jump directly return string returned by ModelAndView object
2) Write back data directly return string return object or set
4.2 page Jump
1. Return string form
Directly return string: this method will splice the returned string with the front suffix ...
Posted by vinod79 on Mon, 11 Oct 2021 18:17:53 -0700
Use IDEA to create Maven project, integrate spring MVC and MyBatis framework, and complete a simple check-in program
catalogue
Environment construction
database
Create Maven project
Configuration item
Write project
Create package structure
Writing back-end code
pojo package
util package
service package
serviceimpl package
controller package
Create front-end display page
Possible problems
Tomcat startup failed.
Garbled code problem
We ...
Posted by davidjam on Sat, 09 Oct 2021 03:00:56 -0700
Spring MVC ------ exception handling
exception handling
Exception handler
Exception classification management
code:
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRespon ...
Posted by almystersv on Tue, 05 Oct 2021 17:42:20 -0700
[Spring] IoC Control Reverse: What is IoC? What is a container? Write a simple Spring program to see!
Two months ago, I completed the Spring Framework with the Spring Framework tutorial video of Mr. Wang He, the power node of station b. During the learning process, I tapped the code involved in the video line by line, and sorted out the materials related to the introduction of Spring. Here I record my notes and some insights during the learning ...
Posted by ozman26 on Tue, 05 Oct 2021 09:27:35 -0700
Spring MVC creation and execution process
springMVC
Servlet------------>jsp
out.print() out.write()
model1 jsp + javabean
model2 MVC jsp+servlet+javabean
M:model Java class
5: View view
C: controller servlet
frame
ssh: struts1 | struts2 | springmvc spring hibernate
ssm: springmvc spring mybatis
jsp
jstl+el | ajax:json
M: Model ordinary java class mybatis: persiste ...
Posted by chris9902 on Tue, 21 Sep 2021 04:57:24 -0700