javascript
SpringMVC的环境搭建
第一節(jié) SpringMVC的環(huán)境搭建
2016年3月7日 星期一
09:04
?
MyBatis框架-->持久層框架-->Object【對象】Relation[關(guān)系型數(shù)據(jù)庫]Mapping[在MyBatis的體現(xiàn)是哪個映射文件中國的<resultMap>標簽]框架? 對JDBC的封裝,需要定制SQL語句
處理的是DataAccessOBject數(shù)據(jù)訪問對象
?
SpringMVC它隸屬于Spring框架,它只是Spring這個龐大框架下的一個小模塊,SpringMVC是替換我們之前學過的Servlet,在我們下面的課程的時候需要你回顧Servlet
?
如何學習一個框架?
1.找jar
2.配置核心配置文件
3.讀取核心配置文件
4.測試Hello World
讀取核心配置文件:MyBatis的時候,是由我們自己控制讀取mybatis-config.xml Java
SpringMVC框架,WEB層,動態(tài)Web項目
第一步:找到Jar[19個]
第二步:建立核心配置文件
?
The?DispatcherServlet?is an actual?Servlet?(it inherits from the?HttpServlet?base class), and as such is declared in the?web.xml[部署描述符]?of your web application. You need to map requests that you want the?DispatcherServlet?to handle, by using a URL mapping in the same?web.xml?file. This is standard Java EE Servlet configuration; the following example shows such a?DispatcherServlet?declaration and mapping:
?
Servlet的生命周期
發(fā)送請求——>如果你是第一次訪問獲取使用服務(wù)器進行初始化操作 init()方法實例化
--》service方法->判斷用doget、dopost
<load-on-startup>1</load-on-startup>
<load-on-startup>當服務(wù)器啟動的時候就對該Servlet實話,并且值越小越被優(yōu)先加載</load-on-startup>
?
?
?
JSP的生命周期[自己去百度]
?
Upon initialization of a?DispatcherServlet, Spring MVC looks for a file named?[servlet-name]-servlet.xml?in the?WEB-INF?directory of your web application and creates the beans defined there, overriding the definitions of any beans defined with the same name in the global scope.
?
?
?
?
?
?
跳轉(zhuǎn):
請求轉(zhuǎn)發(fā):地址欄路徑不變[默認的跳轉(zhuǎn)方式]
?
重定向:地址欄改變
配置視圖解析器
?
?
?
?
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'homeController' method
?
?
?
?
?
?
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/skycodefamily/p/5348194.html
總結(jié)
以上是生活随笔為你收集整理的SpringMVC的环境搭建的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: PHP开发APP接口(二)
- 下一篇: IOS 手势详解
