1.創(chuàng)建WEB工程
2.添加spring mvc依賴包
3.在web.xml中啟動spring框架
? ?commons-logging.jar(日志輸出)
? ?spring-webmvc.jar(SpringMVC核心包)
? ?spring.jar? ? ? ? (Spring核心包)
4.編寫后臺邏輯
5.編寫Controller控制器
6.編寫applicationContext.xml
編寫web.xml步驟:
1.編寫啟動spring框架的Servlet
2.在Servlet標(biāo)簽中注冊applicationContext.xml
3.在Servlet標(biāo)簽中設(shè)置spring啟動類在類加載時啟動
編寫applicationContext.xml步驟:
1.注冊Controller控制器
2.捆綁URL和Controller
3.設(shè)置URL的前綴和后綴