1.1 项目源码
2.1 方式一
spring mvc注解驱动(annotation-driven)和扫描器(component-scan)
@Controller and @RequestMapping(value = "/hello.do")
2.2 方式二
最主要的一点,此方式的项目中没有类似springmvc02-servlet.xml的springmvc配置文件
而是定义了一个配置springmvc的类
@Configuration and @ComponentScan(basePackages = "com.songyl.webmvc.controller")
3. 配置HandlerMapping 的三种方式:
4. 请求参数的三种方式:
在UserController.java里面配置
| 属 性 |描 述 |是否必须 |缺省值 |
|----------- |:-------------------:|:---------:|:-------------------|
| items | 进行循环的项目 | 否 |无 |
| begin | 开始条件 | 否 | 0 |
| end | 结束条件 | 否 | 集合中的最后一个项目 |
| step | 步长 | 否 | 1 |
| var |代表当前项目的变量名 | 否 | 无 |
| varStatus | 显示循环状态的变量 | 否 | 无 |