<!--注解映射器 -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
<!--注解适配器 -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/> <!-- 对于注解的Handler可以单个配置
实际开发中建议使用组件扫描
-->
<!-- <bean class="cn.itcast.ssm.controller.ItemsController3" /> -->
<!-- 可以扫描controller、service、...
这里让扫描controller,指定controller的包
-->
<context:component-scan base-package="com.test.handler.items"></context:component-scan>

对于handler不需要实现任何接口

@Controller
public class ItemsHandler3 { @RequestMapping("/queryitems")
public ModelAndView queryitems(){
//*****************
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject(itemsList);
modelAndView.setViewName("/WEB-INF/jsp/items/itemsList.jsp");
return modelAndView;
}

访问路径为/queryitems.action

注解SpringMVC的更多相关文章

  1. [译]SpringMVC自定义验证注解(SpringMVC custom validation annotations)

    在基于SpringMVC框架的开发中,我们经常要对用户提交的字段进行合法性验证,比如整数类型的字段有个范围约束,我们会用@Range(min=1, max=4).在实际应用开发中,我们经常碰到一些自己 ...

  2. Hibernate validation 注解 springmvc 验证 分组

    SpringMVC验证框架Validation特殊用法   1. 分组 有的时候,我们对一个实体类需要有多中验证方式,在不同的情况下使用不同验证方式,比如说对于一个实体类来的id来说,保存的时候是不需 ...

  3. 非注解SpringMVC

    <!-- SpringMVC前端控制器 --> <servlet> <servlet-name>springmvc</servlet-name> < ...

  4. @ModelAttribute注解(SpringMVC)

    在方法定义上使用 @ModelAttribute 注解:Spring MVC 在调用目标处理方法前,会先逐个调用在方法级上标注了 @ModelAttribute 的方法. 在方法的入参前使用 @Mod ...

  5. springBoot注解大全JPA注解springMVC相关注解全局异常处理

    https://www.cnblogs.com/tanwei81/p/6814022.html 一.注解(annotations)列表 @SpringBootApplication:包含了@Compo ...

  6. 4.Spring注解+SpringMVC注解+MyBatis注解(动态sql)

    1.创建如图所示项目结构 2.在项目的

  7. 缓存初解(五)---SpringMVC基于注解的缓存配置--web应用实例

    之前为大家介绍了如何使用spring注解来进行缓存配置 (EHCache 和 OSCache)的简单的例子,详见 Spring基于注解的缓存配置--EHCache AND OSCache 现在介绍一下 ...

  8. springmvc注解式开发

    搭建环境 后端控制器无需实现接口,添加相应的注解 springmvc配置文件中无需注册controller springmvc配置文件中添加组件扫描器.注解驱动 涉及常用的注解 @controller ...

  9. Spring和springmvc父子容器注解扫描问题详解

      一.Spring容器和springmvc容器的关系如下图所示: Spring和springmvc和作为两个独立的容器,会把扫描到的注解对象分别放到两个不同的容器中, Springmvc容器是spr ...

随机推荐

  1. Android手机应用程序开发环境配置(Eclipse+Java+ADT)

    参考: Java手机游戏开发实例简明教程 http://dev.10086.cn/blog/?uid-82940-action-viewspace-itemid-1772 Eclipse下载: htt ...

  2. Two kinds of Quaternion SlerpImp (Unity)

    using UnityEngine;using System.Collections; public class SlerpImp{ static float Dot(Quaternion a, Qu ...

  3. [MCM]2014年美赛MCM题目原文及翻译

    PROBLEM A: The Keep-Right-Except-To-Pass Rule In countries where driving automobiles on the right is ...

  4. Axure初体验:简单交互、通过按钮切换图片

    前言: 之前是一直用processon的UI原型设计,后来感觉只能完成静态页面的processon满足不了原型设计的需求,断网时候也不方便修改.展示.最终还是决定学习动态页面的制作,所选工具为原型设计 ...

  5. zoj 3757 Alice and Bob and Cue Sports 月赛A 模拟

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3757 题意:根据所给的台球规则,按照每次的结果计算最终两人的得分 ...

  6. windows 下文件上传到fastdfs

    php.ini 配置 [fastdfs]; the base pathfastdfs_client.base_path = D:/tmp ; connect timeout in seconds; d ...

  7. sql 数据字段类型

    bit    整型 bit数据类型是整型,其值只能是0.1或空值.这种数据类型用于存储只有两种可能值的数据,如Yes 或No.True 或False .On 或Off. 注意:很省空间的一种数据类型, ...

  8. 53个要点提高php效率

    用单引号代替双引号来包含字符串,这样做会更快一些.因为PHP会在双引号包围的字符串中搜寻变量,单引号则不会,注意:只有echo能这么做,它是一种可以把多个字符串当作参数的“函数”(译注:PHP手册中说 ...

  9. CSS3 经典教程系列:CSS3 线性渐变(linear-gradient)

    摘自: http://www.cnblogs.com/lhb25/archive/2013/01/30/css3-linear-gradient.html

  10. nodejs端口被占用。

    I had the same issue. I ran: $ ps aux | grep node to get the process id, then: $ sudo kill -9 follow ...