欢迎来到天天文库
浏览记录
ID:8973370
大小:158.36 KB
页数:7页
时间:2018-04-13
《springmvc最基础配置》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、SpringMVC最基础配置冰上浮云2014-3-4SpringMVC和Struts2一样,是前后台的一个粘合剂,struts2用得比较熟悉了,现在来配置一下SpringMVC,看看其最基础配置和基本使用。SpriingMVC不是太难,学习成本不高,现在很多人都喜欢使用它了。本次demo工程是一个maven工程,使用maven来对项目进行管理。一、首先需要建立一个maven的webapp工程。目录结构如下:二、配置maven的pox.xmljunitjunit
2、4.10testorg.springframeworkspring-webmvc3.2.8.RELEASEjstljstl1.1.2Maven配置界面如下图。这里我们
3、使用的spring版本是3.2.8.RELEASE;配置好后,maven会自动给我们加载其他依赖的jar包,如下图:具体依赖的包如下:1)aopalliance-1.0.jar2)commons-logging-1.1.3.jar3)spring-aop-3.2.8.RELEASE.jar4)spring-beans-3.2.8.RELEASE.jar5)spring-context-3.2.8.RELEASE.jar6)spring-core-3.2.8.RELEASE.jar7)spring-expression-3.2.8.RELEASE.jar8)spring-web-3.2.8
4、.RELEASE.jar9)spring-webmvc-3.2.8.RELEASE.jar10)jstl-1.1.2.jar三、工程配置1、建立一个最基础的springMVC测试工程目录结构如下图:2、application_spring_mvc.xml5、ingframework.org/schema/tx"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.2.xsdhttp://www.springframework.or6、g/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.2.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.2.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
5、ingframework.org/schema/tx"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.2.xsdhttp://www.springframework.or
6、g/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.2.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.2.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
此文档下载收益归作者所有