idea15 新建項(xiàng)目
選擇maven
填寫(xiě)項(xiàng)目標(biāo)示
選擇pom.xml文件
加入springMVC 的jar包斯碌,spring-context,spring-web窑邦,spring-webmvc拜英,servlet-api等
在maven加入springMVC等jar包
選擇項(xiàng)目右鍵選擇Reimport更新maven下載jar包到項(xiàng)目本地
新建一個(gè)action 類
引入jar包到項(xiàng)目中之后就可以使用注解
在項(xiàng)目后resources中新建配置文件
配置掃描action包
最后在web.xml文件中配一個(gè)總的中央控制器垢油,和*.連接后綴的過(guò)濾器
配一個(gè)總的中央控制器盆驹,和*.連接后綴(.do或者.json)的過(guò)濾器
最后配置tomcat 本地測(cè)試
點(diǎn)擊file選擇project ?structure ?,選擇modules,加入tomcat JAR包
配置tomcat
配置tomcat部署目錄
連接后加入?yún)?shù)可傳遞到服務(wù)器讀取