【引入包】
1/spring-framework-3.1.1.RELEASE-with-docs.zip/dist/下的所有jar包拷贝到项目的WEB-INF/lib目录下。
2/Spring 框架依赖的 jar 包commons.logging-1.1.1.jar。
3/需要添加 jstl 标签库支持 jstl-1.1.2.jar 和 standard-1.1.2.jar。
==================================================================================
基于配置文件的springMVC配置
------------------------------------------------------------------------------------
【web.xml】
【spring.xml】
springXML命名规则:chapter2-servlet
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
">
==================================================================================================
基于注解的springMVC配置
-----------------------------------------------------------------------------------
1/【web.xml】
2/【spring.xml】只保留视图解析器
springXML命名规则:chapter2-servlet
3/【注解使用】
controller类使用
@Controller() //标识是springmvc的处理器类
@RequestMapping("controller1") //controller的唯一标识或者命名空间
方法使用@RequestMapping("/toTest7.do")标识
-------------------------------------------------------------------