Introduction: Spring Model-view-controller (MVC) is the most widely used module in the Spring Framework. It is based on a clean design and offers a lot of out-of-the-box classes. This tutorial is the fifth part of a series of tutorials (a total of six parts) detailing Spring
Spring MVC stands straight and says, "dependency injection, I am here !, Mvc waist
Study Spring MVC to distribute requests to Spring dependent injection class instances
Beautiful Life of the sun and fire god (http://blog.csdn.net
1) Copy the Lib package required by spring(This is the Lib package required by SSH, if you only use spring, you can remove some packages)2) Configure Web. xmlXML version= "1.0" encoding= "UTF-8"?>Web-appversion= "3.0"xmlns= "Http://java.sun.com/xml/ns/javaee"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:sch
Document directory
Code snippets in this article
Create spring-managed JAX-RS resources in Jersey
Create spring MVC @ controller class
Scope of web layer components
Request Parameters, cookies, and HTTP headers
Process data in the Request body
Set response body data with JAX-RS
Use
Study Spring MVC distributing requests to class instances of spring dependency InjectionThe beautiful Life of the Sun Vulcan (http://blog.csdn.net/opengl_es)This article follows "Attribution-non-commercial use-consistent" authoring public agreementReprint Please keep this sentence: Sun Vulcan's Beautiful Life-this blog focuses on Agile development and mobile and
In the previous article, I introduced in detail how to build a maven environment and generate a maven skeleton web project. In this chapter, I will describe the process structure of Spring MVC, differences Between Spring MVC and Struts2, and analysis of some configuration fi
.
Parameters:
View-view object to render (usually a Servlet MVC View object)
Modelname-name of the single entry in the model
Modelobject-the Single Model Object
Here our view is OK, according to the view parser, we will find/web-inf/views/ok.jsp
At the same time passed model.
At this point, the ok.jsp display msg value is very simple, you need to reference jstl. Use the EL expression display.
1. The purpose of Spring MVCBuild Web applications that are flexible and loosely coupled to the spring framework.2. How do I handle request in Spring MVC?Whenever a user clicks a link or submits a form in a Web browser, the reques
Dispatcherservlet object can intercept the corresponding request - servlet> Servlet-name>DispatcherServlet-name> Servlet-class>Org.springframework.web.servlet.DispatcherServletServlet-class> - Load-on-startup>1Load-on-startup> servlet> servlet-mapping> Servlet-name>DispatcherServlet-name> Url-pattern>*.doUrl-pattern> servlet-mapping> Specify a context loader in Web. XML, so that Dispatcherservlet
Spring mvc static file access and spring mvc static access
Spring mvc cannot access static resource files when the following configuration is in the web. xml file:
MvcCoreServl
. Springorm: The spring framework inserts several ORM frameworks, providing an ORM Object- relational tool that includes JDO, Hibernate and iBatis SQL Map. All of these conform to Spring's common transaction and DAO exception hierarchies. Spring Web module : The Web context module is built on top of the application c
MVC allows extremely flexible request processing method signing methods. For method input parameters, multiple types of input parameters are allowed, which are described in the following table:
Optional type of request processing method input parameters
Description
Java basic data type and string
By default, the URL parameter is bound by name matching. You can use the @ requestparam annotation to change the default bi
Spring MVC Configuration1. Importing the JAR Package2. Add configuration about SPRINGMVC in the Web. XML configuration fileclass >org.springframework.web.servlet.dispatcherservletclass> 3. Add springmvc-servlet.xml config file under srcXmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:context= "Http://www.springframework.org/schema/context"Xmlns:
be errors such as the following:[ERROR] ... very long ERROR ...: invalid LOC header (bad signature).Cause: This indicates that it is very likely that there are some dependencies of binary file corruption.How to resolve:Delete ". M2/repository" and then perform the Maven install again download dependency repository. 5, problem #5[ERROR] ... very long errors ...: unresolvedaddressexceptionReason:A, assume that you use the domain name in the settings.xml file agent (such as :p roxy.its.ac.id), it
Spring MVC interceptor 01 and spring MVC blocker 01
Spring MVC InterceptionRole: identity verification and permission check to prevent unauthorized access.Scenario: In a bbs system, users cannot post or delete comments without lo
, and subversionSpring Cloud Busevent, message bus, used to propagate state changes in a cluster (for example, configuration change events), which can be combined with Spring Cloud config for hot deploymentEurekaCloud service discovery, a REST-based service for locating services to enable mid-tier service discovery and failover in the cloud.Hystrixfuses, fault-tolerant management tools, designed to control the nodes of services and third-party librari
.
Solution:
A. In the first case, use the IP address proxy in the settings. xml file to replace the domain name.
B. If the network is connected directly, delete the proxy configuration in the settings. xml file.
Finally, we hope this tutorial will help you use STS for Spring mvc development.
Vi. References
[1] http://www.mkyong.com/
, destruction, callback, and so on.
framework: Spring, as a framework, provides some basic functionality, such as transaction management, persistence layer integration, and so on, so that developers are more focused on developing application logic.
See what spring is and see what spring does
1. Using spring's IOC container, the d
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.