日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

SpringMVC的环境搭建

發布時間:2025/4/14 javascript 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SpringMVC的环境搭建 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

第一節 SpringMVC的環境搭建

2016年3月7日 星期一

09:04

?

MyBatis框架-->持久層框架-->Object【對象】Relation[關系型數據庫]Mapping[在MyBatis的體現是哪個映射文件中國的<resultMap>標簽]框架? 對JDBC的封裝,需要定制SQL語句

處理的是DataAccessOBject數據訪問對象

?

SpringMVC它隸屬于Spring框架,它只是Spring這個龐大框架下的一個小模塊,SpringMVC是替換我們之前學過的Servlet,在我們下面的課程的時候需要你回顧Servlet

?

如何學習一個框架?

1.找jar

2.配置核心配置文件

3.讀取核心配置文件

4.測試Hello World

讀取核心配置文件:MyBatis的時候,是由我們自己控制讀取mybatis-config.xml Java

SpringMVC框架,WEB層,動態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的生命周期

發送請求——>如果你是第一次訪問獲取使用服務器進行初始化操作 init()方法實例化

--》service方法->判斷用doget、dopost

<load-on-startup>1</load-on-startup>

<load-on-startup>當服務器啟動的時候就對該Servlet實話,并且值越小越被優先加載</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.


?


?

?


?

?

?

跳轉:

請求轉發:地址欄路徑不變[默認的跳轉方式]

?

重定向:地址欄改變


配置視圖解析器


?

?

?

?

Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'homeController' method

?


?

?

?

?

?

?

?

轉載于:https://www.cnblogs.com/skycodefamily/p/5348194.html

總結

以上是生活随笔為你收集整理的SpringMVC的环境搭建的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。