读Spring的源代码六:Controller mapping的注册过程
2015-07-28 11:26
218 查看
DispatchServlet每次收到请求后,都会去一个LinkedHashMap(handlerMethods)里面找对应的handler。这个map的初始化过程在下图你可以找到。 这个map是放在AbstractHandlerMethodMapping中的。
注:观察下面方法你会发现spring会根据时候含有注释Controller或RequestMapping来判断是否是handler。
注:观察下面方法你会发现spring会根据时候含有注释Controller或RequestMapping来判断是否是handler。
protected boolean isHandler(Class<?> beanType) { return ((AnnotationUtils.findAnnotation(beanType, Controller.class) != null) || (AnnotationUtils.findAnnotation(beanType, RequestMapping.class) != null)); }
相关文章推荐
- android使用ViewPager实现欢迎引导页
- iOS键值编码(KVC)与键值监听(KVO)
- iOS证书说明和发布内购流程整理
- android使用ViewPager实现欢迎引导页
- ios背景更新和下载
- Objective-C #pragma
- Android working with Volley Library
- iOS开发之AsyncSocket使用教程(刚刚)
- android————AlertDialog,ProGressDialog
- iOS中几种数据持久化方案
- android Notification
- android 应用获取系统权限
- Android:关闭软键盘自动弹出的解决方案
- android应用中去掉标题栏的方法
- 如何快速成为iOS游戏开发达人
- android背景色改为透明色
- Mac AppStore 登陆提示 未知错误
- unity3d v5.1.2 如何顺序播放音乐
- Mac AppStore 登陆提示 未知错误
- 查看Android应用包名package和入口activity名称