# 第三章 DispatcherServlet詳解 ——跟開濤學SpringMVC
##
3.1、DispatcherServlet作用
DispatcherServlet是前端控制器設計模式的實現,提供Spring Web MVC的集中訪問點,而且負責職責的分派,而且與Spring IoC容器無縫集成,從而可以獲得Spring的所有好處。?具體請參考第二章的圖2-1。
DispatcherServlet主要用作職責調度工作,本身主要用于控制流程,主要職責如下:
1、文件上傳解析,如果請求類型是multipart將通過MultipartResolver進行文件上傳解析;
2、通過HandlerMapping,將請求映射到處理器(返回一個HandlerExecutionChain,它包括一個處理器、多個HandlerInterceptor攔截器);
3、通過HandlerAdapter支持多種類型的處理器(HandlerExecutionChain中的處理器);
4、通過ViewResolver解析邏輯視圖名到具體視圖實現;
5、本地化解析;
6、渲染具體的視圖等;
7、如果執行過程中遇到異常將交給HandlerExceptionResolver來解析。
從以上我們可以看出DispatcherServlet主要負責流程的控制(而且在流程中的每個關鍵點都是很容易擴展的)。
## 3.2、DispatcherServlet在web.xml中的配置
```
<servlet>
<servlet-name>chapter2</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>chapter2</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
```
**load-on-startup:**表示啟動容器時初始化該Servlet;
**url-pattern:**表示哪些請求交給Spring Web MVC處理,?“/”?是用來定義默認servlet映射的。也可以如“*.html”表示攔截所有以html為擴展名的請求。
該DispatcherServlet默認使用WebApplicationContext作為上下文,Spring默認配置文件為“/WEB-INF/[servlet名字]-servlet.xml”。
DispatcherServlet也可以配置自己的初始化參數,覆蓋默認配置:
摘自Spring Reference
| **參數** | **描述** |
| --- | --- |
| contextClass | 實現WebApplicationContext接口的類,當前的servlet用它來創建上下文。如果這個參數沒有指定, 默認使用XmlWebApplicationContext。 |
| contextConfigLocation | 傳給上下文實例(由contextClass指定)的字符串,用來指定上下文的位置。這個字符串可以被分成多個字符串(使用逗號作為分隔符) 來支持多個上下文(在多上下文的情況下,如果同一個bean被定義兩次,后面一個優先)。 |
| namespace | WebApplicationContext命名空間。默認值是[server-name]-servlet。 |
因此我們可以通過添加初始化參數
```
<servlet>
<servlet-name>chapter2</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-servlet-config.xml</param-value>
</init-param>
</servlet>
```
如果使用如上配置,Spring Web MVC框架將加載“classpath:spring-servlet-config.xml”來進行初始化上下文而不是“/WEB-INF/[servlet名字]-servlet.xml”。
## 3.3、上下文關系
集成Web環境的通用配置:
```
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring-common-config.xml,
classpath:spring-budget-config.xml
</param-value>
</context-param>
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
```
如上配置是Spring集成Web環境的通用配置;一般用于加載除Web層的Bean(如DAO、Service等),以便于與其他任何Web框架集成。
contextConfigLocation:表示用于加載Bean的配置文件;
contextClass:表示用于加載Bean的ApplicationContext實現類,默認WebApplicationContext。
創建完畢后會將該上下文放在ServletContext:
servletContext.setAttribute(
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
this.context);
**ContextLoaderListener初始化的上下文和DispatcherServlet初始化的上下文關系,如圖3-1**

圖3-1
從圖中可以看出:
ContextLoaderListener初始化的上下文加載的Bean是對于整個應用程序共享的,不管是使用什么表現層技術,一般如DAO層、Service層Bean;
DispatcherServlet初始化的上下文加載的Bean是只對Spring Web MVC有效的Bean,如Controller、HandlerMapping、HandlerAdapter等等,該初始化上下文應該只加載Web相關組件。
## 3.4、DispatcherServlet初始化順序
**繼承體系結構如下所示:**

1、**HttpServletBean繼承HttpServlet,**因此在Web容器啟動時將調用它的init方法,該初始化方法的主要作用
:::將Servlet初始化參數(init-param)設置到該組件上(如contextAttribute、contextClass、namespace、contextConfigLocation),通過BeanWrapper簡化設值過程,方便后續使用;
:::提供給子類初始化擴展點,initServletBean(),該方法由FrameworkServlet覆蓋。
```
public abstract class HttpServletBean extends HttpServlet implements EnvironmentAware{
@Override
public final void init() throws ServletException {
//省略部分代碼
//1、如下代碼的作用是將Servlet初始化參數設置到該組件上
//如contextAttribute、contextClass、namespace、contextConfigLocation;
try {
PropertyValues pvs = new ServletConfigPropertyValues(getServletConfig(), this.requiredProperties);
BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
ResourceLoader resourceLoader = new ServletContextResourceLoader(getServletContext());
bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader, this.environment));
initBeanWrapper(bw);
bw.setPropertyValues(pvs, true);
}
catch (BeansException ex) {
//…………省略其他代碼
}
//2、提供給子類初始化的擴展點,該方法由FrameworkServlet覆蓋
initServletBean();
if (logger.isDebugEnabled()) {
logger.debug("Servlet '" + getServletName() + "' configured successfully");
}
}
//…………省略其他代碼
}
```
**2、FrameworkServlet繼承HttpServletBean,**通過initServletBean()進行Web上下文初始化,該方法主要覆蓋一下兩件事情:
初始化web上下文;
提供給子類初始化擴展點;
```
public abstract class FrameworkServlet extends HttpServletBean {
@Override
protected final void initServletBean() throws ServletException {
//省略部分代碼
try {
//1、初始化Web上下文
this.webApplicationContext = initWebApplicationContext();
//2、提供給子類初始化的擴展點
initFrameworkServlet();
}
//省略部分代碼
}
}
```
```
protected WebApplicationContext initWebApplicationContext() {
//ROOT上下文(ContextLoaderListener加載的)
WebApplicationContext rootContext =
WebApplicationContextUtils.getWebApplicationContext(getServletContext());
WebApplicationContext wac = null;
if (this.webApplicationContext != null) {
// 1、在創建該Servlet注入的上下文
wac = this.webApplicationContext;
if (wac instanceof ConfigurableWebApplicationContext) {
ConfigurableWebApplicationContext cwac = (ConfigurableWebApplicationContext) wac;
if (!cwac.isActive()) {
if (cwac.getParent() == null) {
cwac.setParent(rootContext);
}
configureAndRefreshWebApplicationContext(cwac);
}
}
}
if (wac == null) {
//2、查找已經綁定的上下文
wac = findWebApplicationContext();
}
if (wac == null) {
//3、如果沒有找到相應的上下文,并指定父親為ContextLoaderListener
wac = createWebApplicationContext(rootContext);
}
if (!this.refreshEventReceived) {
//4、刷新上下文(執行一些初始化)
onRefresh(wac);
}
if (this.publishContext) {
// Publish the context as a servlet context attribute.
String attrName = getServletContextAttributeName();
getServletContext().setAttribute(attrName, wac);
//省略部分代碼
}
return wac;
}
```
從initWebApplicationContext()方法可以看出,基本上如果ContextLoaderListener加載了上下文將作為根上下文(DispatcherServlet的父容器)。
最后調用了onRefresh()方法執行容器的一些初始化,這個方法由子類實現,來進行擴展。
**3、DispatcherServlet繼承FrameworkServlet**,并實現了onRefresh()方法提供一些前端控制器相關的配置:
```
public class DispatcherServlet extends FrameworkServlet {
//實現子類的onRefresh()方法,該方法委托為initStrategies()方法。
@Override
protected void onRefresh(ApplicationContext context) {
initStrategies(context);
}
//初始化默認的Spring Web MVC框架使用的策略(如HandlerMapping)
protected void initStrategies(ApplicationContext context) {
initMultipartResolver(context);
initLocaleResolver(context);
initThemeResolver(context);
initHandlerMappings(context);
initHandlerAdapters(context);
initHandlerExceptionResolvers(context);
initRequestToViewNameTranslator(context);
initViewResolvers(context);
initFlashMapManager(context);
}
}
```
從如上代碼可以看出,DispatcherServlet啟動時會進行我們需要的Web層Bean的配置,如HandlerMapping、HandlerAdapter等,而且如果我們沒有配置,還會給我們提供默認的配置。
從如上代碼我們可以看出,整個DispatcherServlet初始化的過程和做了些什么事情,具體主要做了如下兩件事情:
1、初始化Spring Web MVC使用的Web上下文,并且可能指定父容器為(ContextLoaderListener加載了根上下文);
2、初始化DispatcherServlet使用的策略,如HandlerMapping、HandlerAdapter等。
服務器啟動時的日志分析(此處加上了ContextLoaderListener從而啟動ROOT上下文容器):
信息: Initializing Spring root WebApplicationContext?**//由ContextLoaderListener啟動ROOT上下文**
2012-03-12?13:33:55?[main] INFO??**org.springframework.web.context.ContextLoader**?- Root WebApplicationContext: initialization started
2012-03-12?13:33:55?[main] INFO? org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Mon?Mar 12 13:33:55 CST 2012]; root of context hierarchy
2012-03-12?13:33:55?[main] DEBUG org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions
2012-03-12?13:33:55?[main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loaded 0 bean definitions from location pattern?**[/WEB-INF/ContextLoaderListener.xml]**
2012-03-12?13:33:55?[main] DEBUG org.springframework.web.context.support.XmlWebApplicationContext - Bean factory for Root WebApplicationContext: org.springframework.beans.factory.support.DefaultListableBeanFactory@1c05ffd: defining beans []; root of factory hierarchy
2012-03-12?13:33:55?[main] DEBUG org.springframework.web.context.support.XmlWebApplicationContext - Bean factory for Root WebApplicationContext:
**2012-03-12 13:33:55 [main] DEBUG org.springframework.web.context.ContextLoader - Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]?//將ROOT上下文綁定到ServletContext**
2012-03-12 13:33:55 [main] INFO? org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 438 ms**? //到此ROOT上下文啟動完畢**
2012-03-12?13:33:55?[main] DEBUG org.springframework.web.servlet.DispatcherServlet - Initializing servlet 'chapter2'
信息: Initializing Spring FrameworkServlet 'chapter2'??**//開始初始化FrameworkServlet對應的Web上下文**
2012-03-12?13:33:55?[main] INFO? org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'chapter2': initialization started
2012-03-12 13:33:55 [main] DEBUG org.springframework.web.servlet.DispatcherServlet - Servlet with name 'chapter2' will try to**?create custom WebApplicationContext context**?of class 'org.springframework.web.context.support.XmlWebApplicationContext',?**using parent context [Root WebApplicationContext**: startup date [Mon?Mar 12 13:33:55 CST 2012]; root of context hierarchy]
**//此處使用Root WebApplicationContext作為父容器。**
2012-03-12?13:33:55?[main] INFO? org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for?namespace 'chapter2-servlet': startup date [Mon?Mar 12 13:33:55 CST 2012]; parent: Root WebApplicationContext
2012-03-12?13:33:55?[main] INFO? org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [**/WEB-INF/chapter2-servlet.xml]**
2012-03-12?13:33:55?[main] DEBUG org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions
2012-03-12 13:33:55 [main] DEBUG org.springframework.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name**[org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping#0]? //我們配置的HandlerMapping**
2012-03-12 13:33:55 [main] DEBUG org.springframework.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name**[org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter#0]?//我們配置的HandlerAdapter**
2012-03-12 13:33:55 [main] DEBUG org.springframework.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.web.servlet.view.InternalResourceViewResolver#0]?**//我們配置的ViewResolver**
2012-03-12?13:33:55?[main] DEBUG org.springframework.beans.factory.xml.BeanDefinitionParserDelegate - No XML 'id' specified - using '/hello' as bean name and [] as aliases?
**//我們的處理器(HelloWorldController)**
2012-03-12?13:33:55?[main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loaded 4 bean definitions from location pattern [/WEB-INF/chapter2-servlet.xml]
2012-03-12 13:33:55 [main] DEBUG org.springframework.web.context.support.XmlWebApplicationContext - Bean factory for WebApplicationContext for namespace 'chapter2-servlet': org.springframework.beans.factory.support.DefaultListableBeanFactory@1372656: defining beans [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping#0,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0,/hello]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1c05ffd
**//到此容器注冊的Bean初始化完畢**
2012-03-12?13:33:56?[main] DEBUG org.springframework.web.servlet.DispatcherServlet - Unable to locate MultipartResolver with name 'multipartResolver': no multipart request handling provided
2012-03-12?13:33:56?[main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver'
**//默認的LocaleResolver注冊**
2012-03-12?13:33:56?[main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.theme.FixedThemeResolver'
**//默認的ThemeResolver注冊**
2012-03-12?13:33:56?[main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping#0'
**//發現我們定義的HandlerMapping?不再使用默認的HandlerMapping。**
2012-03-12?13:33:56?[main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter#0'
**//發現我們定義的HandlerAdapter?不再使用默認的HandlerAdapter。**
2012-03-12?13:33:56?[main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver'
**//異常處理解析器ExceptionResolver**
2012-03-12?13:33:56?[main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver'
2012-03-12?13:33:56?[main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.web.servlet.view.InternalResourceViewResolver#0'
2012-03-12?13:33:56?[main] DEBUG org.springframework.web.servlet.DispatcherServlet - Published WebApplicationContext of servlet 'chapter2' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.chapter2]
**//綁定FrameworkServlet初始化的Web上下文到ServletContext**
2012-03-12?13:33:56?[main] INFO? org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'chapter2': initialization completed in ?297 ms
2012-03-12?13:33:56?[main] DEBUG org.springframework.web.servlet.DispatcherServlet - Servlet 'chapter2' configured successfully
**//到此完整流程結束**?
從如上日志我們也可以看出,DispatcherServlet會進行一些默認的配置。接下來我們看一下默認配置吧。
## 3.5、DispatcherServlet默認配置
DispatcherServlet的默認配置在DispatcherServlet.properties(和DispatcherServlet類在一個包下)中,而且是當Spring配置文件中沒有指定配置時使用的默認策略:

org.springframework.web.servlet.LocaleResolver=org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver
org.springframework.web.servlet.ThemeResolver=org.springframework.web.servlet.theme.FixedThemeResolver
org.springframework.web.servlet.HandlerMapping=org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,\
org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
org.springframework.web.servlet.HandlerAdapter=org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,\
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,\
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
org.springframework.web.servlet.HandlerExceptionResolver=org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver,\
org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver,\
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
org.springframework.web.servlet.RequestToViewNameTranslator=org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator
org.springframework.web.servlet.ViewResolver=org.springframework.web.servlet.view.InternalResourceViewResolver
org.springframework.web.servlet.FlashMapManager=org.springframework.web.servlet.support.SessionFlashMapManager
從如上配置可以看出DispatcherServlet在啟動時會自動注冊這些特殊的Bean,無需我們注冊,如果我們注冊了,默認的將不會注冊。
因此如第二章的BeanNameUrlHandlerMapping、SimpleControllerHandlerAdapter是不需要注冊的,DispatcherServlet默認會注冊這兩個Bean。
從DispatcherServlet.properties可以看出有許多特殊的Bean,那接下來我們就看看Spring Web MVC主要有哪些特殊的Bean。
## 3.6、DispatcherServlet中使用的特殊的Bean
DispatcherServlet默認使用WebApplicationContext作為上下文,因此我們來看一下該上下文中有哪些特殊的Bean:
**1、Controller:**處理器/頁面控制器,做的是MVC中的C的事情,但控制邏輯轉移到前端控制器了,用于對請求進行處理;
**2、HandlerMapping:**請求到處理器的映射,如果映射成功返回一個HandlerExecutionChain對象(包含一個Handler處理器(頁面控制器)對象、多個HandlerInterceptor攔截器)對象;如BeanNameUrlHandlerMapping將URL與Bean名字映射,映射成功的Bean就是此處的處理器;
**3、HandlerAdapter:**HandlerAdapter將會把處理器包裝為適配器,從而支持多種類型的處理器,即適配器設計模式的應用,從而很容易支持很多類型的處理器;如SimpleControllerHandlerAdapter將對實現了Controller接口的Bean進行適配,并且掉處理器的handleRequest方法進行功能處理;
**4、ViewResolver:**ViewResolver將把邏輯視圖名解析為具體的View,通過這種策略模式,很容易更換其他視圖技術;如InternalResourceViewResolver將邏輯視圖名映射為jsp視圖;
**5、LocalResover:**本地化解析,因為Spring支持國際化,因此LocalResover解析客戶端的Locale信息從而方便進行國際化;
**6、ThemeResovler:**主題解析,通過它來實現一個頁面多套風格,即常見的類似于軟件皮膚效果;
**7、MultipartResolver:**文件上傳解析,用于支持文件上傳;
**8、HandlerExceptionResolver:**處理器異常解析,可以將異常映射到相應的統一錯誤界面,從而顯示用戶友好的界面(而不是給用戶看到具體的錯誤信息);
**9、RequestToViewNameTranslator:**當處理器沒有返回邏輯視圖名等相關信息時,自動將請求URL映射為邏輯視圖名;
**10、FlashMapManager:**用于管理FlashMap的策略接口,FlashMap用于存儲一個請求的輸出,當進入另一個請求時作為該請求的輸入,通常用于重定向場景,后邊會細述。
到此DispatcherServlet我們已經了解了,接下來我們就需要把上邊提到的特殊Bean挨個擊破,那首先從控制器開始吧。
[
私塾在線學習網](http://sishuok.com/)原創內容([http://sishuok.com](http://sishuok.com/))
原創內容,轉載請注明私塾在線【[http://sishuok.com/forum/blogPost/list/5188.html#16436](http://sishuok.com/forum/blogPost/list/5188.html#16436)】
- 跟我學 Spring3
- 【第二章】 IoC 之 2.1 IoC基礎 ——跟我學Spring3
- 【第二章】 IoC 之 2.2 IoC 容器基本原理 ——跟我學Spring3
- 【第二章】 IoC 之 2.3 IoC的配置使用——跟我學Spring3
- 【第三章】 DI 之 3.1 DI的配置使用 ——跟我學spring3
- 【第三章】 DI 之 3.2 循環依賴 ——跟我學spring3
- 【第三章】 DI 之 3.3 更多DI的知識 ——跟我學spring3
- 【第三章】 DI 之 3.4 Bean的作用域 ——跟我學spring3
- 【第四章】 資源 之 4.1 基礎知識 ——跟我學spring3
- 【第四章】 資源 之 4.2 內置Resource實現 ——跟我學spring3
- 【第四章】 資源 之 4.3 訪問Resource ——跟我學spring3
- 【第四章】 資源 之 4.4 Resource通配符路徑 ——跟我學spring3
- 【第五章】Spring表達式語言 之 5.1 概述 5.2 SpEL基礎 ——跟我學spring3
- 【第五章】Spring表達式語言 之 5.3 SpEL語法 ——跟我學spring3
- 【第五章】Spring表達式語言 之 5.4在Bean定義中使用EL—跟我學spring3
- 【第六章】 AOP 之 6.1 AOP基礎 ——跟我學spring3
- 【第六章】 AOP 之 6.2 AOP的HelloWorld ——跟我學spring3
- 【第六章】 AOP 之 6.3 基于Schema的AOP ——跟我學spring3
- 【第六章】 AOP 之 6.4 基于@AspectJ的AOP ——跟我學spring3
- 【第六章】 AOP 之 6.5 AspectJ切入點語法詳解 ——跟我學spring3
- 【第六章】 AOP 之 6.6 通知參數 ——跟我學spring3
- 【第六章】 AOP 之 6.7 通知順序 ——跟我學spring3
- 【第六章】 AOP 之 6.8 切面實例化模型 ——跟我學spring3
- 【第六章】 AOP 之 6.9 代理機制 ——跟我學spring3
- 【第七章】 對JDBC的支持 之 7.1 概述 ——跟我學spring3
- 【第七章】 對JDBC的支持 之 7.2 JDBC模板類 ——跟我學spring3
- 【第七章】 對JDBC的支持 之 7.3 關系數據庫操作對象化 ——跟我學spring3
- 【第七章】 對JDBC的支持 之 7.4 Spring提供的其它幫助 ——跟我學spring3【私塾在線原創】
- 【第七章】 對JDBC的支持 之 7.5 集成Spring JDBC及最佳實踐 ——跟我學spring3
- 【第八章】 對ORM的支持 之 8.1 概述 ——跟我學spring3
- 【第八章】 對ORM的支持 之 8.2 集成Hibernate3 ——跟我學spring3
- 【第八章】 對ORM的支持 之 8.3 集成iBATIS ——跟我學spring3
- 【第八章】 對ORM的支持 之 8.4 集成JPA ——跟我學spring3
- 【第九章】 Spring的事務 之 9.1 數據庫事務概述 ——跟我學spring3
- 【第九章】 Spring的事務 之 9.2 事務管理器 ——跟我學spring3
- 【第九章】 Spring的事務 之 9.3 編程式事務 ——跟我學spring3
- 【第九章】 Spring的事務 之 9.4 聲明式事務 ——跟我學spring3
- 【第十章】集成其它Web框架 之 10.1 概述 ——跟我學spring3
- 【第十章】集成其它Web框架 之 10.2 集成Struts1.x ——跟我學spring3
- 【第十章】集成其它Web框架 之 10.3 集成Struts2.x ——跟我學spring3
- 【第十章】集成其它Web框架 之 10.4 集成JSF ——跟我學spring3
- 【第十一章】 SSH集成開發積分商城 之 11.1 概述 ——跟我學spring3
- 【第十一章】 SSH集成開發積分商城 之 11.2 實現通用層 ——跟我學spring3
- 【第十一章】 SSH集成開發積分商城 之 11.3 實現積分商城層 ——跟我學spring3
- 【第十二章】零配置 之 12.1 概述 ——跟我學spring3
- 【第十二章】零配置 之 12.2 注解實現Bean依賴注入 ——跟我學spring3
- 【第十二章】零配置 之 12.3 注解實現Bean定義 ——跟我學spring3
- 【第十二章】零配置 之 12.4 基于Java類定義Bean配置元數據 ——跟我學spring3
- 【第十二章】零配置 之 12.5 綜合示例-積分商城 ——跟我學spring3
- 【第十三章】 測試 之 13.1 概述 13.2 單元測試 ——跟我學spring3
- 【第十三章】 測試 之 13.3 集成測試 ——跟我學spring3
- 跟我學 Spring MVC
- SpringMVC + spring3.1.1 + hibernate4.1.0 集成及常見問題總結
- Spring Web MVC中的頁面緩存支持 ——跟我學SpringMVC系列
- Spring3 Web MVC下的數據類型轉換(第一篇)——《跟我學Spring3 Web MVC》搶先看
- Spring3 Web MVC下的數據格式化(第二篇)——《跟我學Spring3 Web MVC》搶先看
- 第一章 Web MVC簡介 —— 跟開濤學SpringMVC
- 第二章 Spring MVC入門 —— 跟開濤學SpringMVC
- 第三章 DispatcherServlet詳解 ——跟開濤學SpringMVC
- 第四章 Controller接口控制器詳解(1)——跟著開濤學SpringMVC
- 第四章 Controller接口控制器詳解(2)——跟著開濤學SpringMVC
- 第四章 Controller接口控制器詳解(3)——跟著開濤學SpringMVC
- 第四章 Controller接口控制器詳解 (4)——跟著開濤學SpringMVC
- 第四章 Controller接口控制器詳解(5)——跟著開濤學SpringMVC
- 跟著開濤學SpringMVC 第一章源代碼下載
- 第二章 Spring MVC入門 源代碼下載
- 第四章 Controller接口控制器詳解 源代碼下載
- 第四章 Controller接口控制器詳解(6)——跟著開濤學SpringMVC
- 第四章 Controller接口控制器詳解(7 完)——跟著開濤學SpringMVC
- 第五章 處理器攔截器詳解——跟著開濤學SpringMVC
- 源代碼下載 第五章 處理器攔截器詳解——跟著開濤學SpringMVC
- 注解式控制器運行流程及處理器定義 第六章 注解式控制器詳解——跟著開濤學SpringMVC
- 源代碼下載 第六章 注解式控制器詳解
- SpringMVC3強大的請求映射規則詳解 第六章 注解式控制器詳解——跟著開濤學SpringMVC
- Spring MVC 3.1新特性 生產者、消費者請求限定 —— 第六章 注解式控制器詳解——跟著開濤學SpringMVC
- SpringMVC強大的數據綁定(1)——第六章 注解式控制器詳解——跟著開濤學SpringMVC
- SpringMVC強大的數據綁定(2)——第六章 注解式控制器詳解——跟著開濤學SpringMVC
- SpringMVC數據類型轉換——第七章 注解式控制器的數據驗證、類型轉換及格式化——跟著開濤學SpringMVC
- SpringMVC數據格式化——第七章 注解式控制器的數據驗證、類型轉換及格式化——跟著開濤學SpringMVC
- SpringMVC數據驗證——第七章 注解式控制器的數據驗證、類型轉換及格式化——跟著開濤學SpringMVC