Home > Back-end >  Integration for SpringMVC
Integration for SpringMVC

Time:11-28

Integration for SpringMVC
For SpringMVC configuration files individually, then in the web. In the XML configuration integrated,

4.3.1, XML configuration spring - the MVC.
Configuration inside comments are very detailed, just don't say here, mainly automatic scanning controller, view mode, start the three annotations,

<? The XML version="1.0" encoding="utf-8"?>
XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance" XMLNS: p="http://www.springframework.org/schema/p"
XMLNS: context="http://www.springframework.org/schema/context"
XMLNS: MVC="http://www.springframework.org/schema/mvc"
Xsi: schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd "& gt;


Text/HTML. Charset=utf-8 & lt;/value>














4.3.2, configuration web. XML file
Here in the face of spring - mybatis. The introduction of XML, and configuration of spring - the Servlet MVC is in order to complete the integration of SSM, before 2 framework integrating don't need any configuration here, configuration has detailed notes, not much explains,

Web.xml

<? The XML version="1.0" encoding="utf-8"?>
XMLNS="http://java.sun.com/xml/ns/javaee"
Xsi: schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
Version="3.0" & gt;
Archetype Created Web Application

ContextConfigLocation
The classpath: spring - mybatis. Xml


EncodingFilter

Org. Springframework. Web. Filter. CharacterEncodingFilter
true

Encoding
Utf-8 & lt;/param - value>



EncodingFilter
/* & lt;/url - pattern>


Org. Springframework. Web. Context. ContextLoaderListener



Org. Springframework. Web. Util. IntrospectorCleanupListener




SpringMVC

Org. Springframework. Web. Servlet. DispatcherServlet

ContextConfigLocation
The classpath: spring - the MVC. Xml

1
true


SpringMVC
/& lt;/url - pattern>


/index. Jsp nullnullnullnullnullnullnullnullnull
  • Related