教你创建springmvc项目 下载本文

内容发布更新时间 : 2024/5/21 11:15:59星期一 下面是文章的全部内容请认真阅读。

springmvc框架

1、spingMVC 入门

1.1 第一步:建立一个web项目 1.2 第二步:导入spring3.2.0相关包

1.3 第三步:在web.xml 的配置前端控制器

springmvc

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:springmvc-servlet.xml

springmvc

.htm

1.4 第四步:spring配置文件

xmlns:ehcache=\m/svn/schema/ehcache-spring\

xmlns:tx=\

xsi:schemaLocation=\s

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/tx

http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/util

http://www.springframework.org/schema/util/spring-util-3.0.xsd http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring

http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.0.xsd\>

1.5 第五步:配置处理器适配器

在springmvc配置文件中配置

class=\lerAdapter\/>

通过查看源码:

此适配器执行实现Controller 接口的Handler