springmvc 的配置 annotation-config/annotation-drive/ component-scan 区别
1. <context:annotation-config /> 作用隐式的配置注解的加载类,默认的加载了AutowiredAnnotationBeanPostProcessor(autowired) ,@Resource、@PostConstruct、@PreDestroy等
2.<mvc:annotation-driven/> 将reques 请求上面的数据绑定到controller 上
3.<context:component-scan base-package="com.xiao.*" /> 自动扫描某个包下带有注解的类,并进行注解的相关操作,@Autowired 注入bean; 另外也包含了1 中所做的操作
springmvc 的配置 annotation-config/annotation-drive/ component-scan 区别的更多相关文章
- org.springframework.stereotype.Service和com.alibaba.dubbo.config.annotation.Service两种service的区别
这两个Service,都可以在service类头上使用@Service的注解,于是我就写错了,查了半天才发现.他们的区别大概是这个样子的: org.springframework.stereotype ...
- SpringBoot从1.5.1→2.2.4项目加包扫雷三:org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter已过时
@Configuration@Slf4j@PropertySource({"classpath:/config.properties"})public class MyWebApp ...
- springMVC+Hibernate配置
本文描述下 sypro 项目中使用 springMVC+Hibernate配置,初学SpringMVC做下简单整理解. 1.web项目首先我们要使用 web.xml文件将 spring配置引入进来 & ...
- SpringBoot扩展SpringMVC自动配置
SpringBoot中自动配置了 ViewResolver(视图解析器) ContentNegotiatingViewResolver(组合所有的视图解析器) 自动配置了静态资源文件夹.静态首页.fa ...
- 学习一下 SpringCloud (五)-- 配置中心 Config、消息总线 Bus、链路追踪 Sleuth、配置中心 Nacos
(1) 相关博文地址: 学习一下 SpringCloud (一)-- 从单体架构到微服务架构.代码拆分(maven 聚合): https://www.cnblogs.com/l-y-h/p/14105 ...
- 基于java代码的Spring-mvc框架配置
Spring 版本 4.3.2 maven项目 1.首先上项目目录图,主要用到的配置文件,略去css和js的文件 引包: 2.主要代码: (1)NetpageWebAppInitializer类 ...
- Idea简单SpringMVC框架配置
前边已经介绍过了Struts在Idea上的配置,相对于Struts来说,我觉得SpringMVC有更多的优势,首先Struts是需要对action进行配置,页面发送不同的请求,就需要配置不同的acti ...
- SpringMVC 学习 十 SSM环境搭建(三)springMVC文件配置
SpringMVC文件配置的详细过程,可以查看springMVC环境搭建的注解配置篇<springMVC学习三 注解开发环境搭建> <?xml version="1.0&q ...
- 19-spring学习-springMVC环境配置
新建一共环境,添加spring支持,就可以开发springMVC了. 既然是springMVC,就必须为其定义相关配置. 1,springMVC所有配置都需要在applicationContext.x ...
- springMVC入门配置案例
1.spring的jar包下载 进入http://repo.springsource.org/libs-release-local/,然后依次点击org/-->springframework-- ...
随机推荐
- github的提交源码到服务器
github是现代的代码库,各种牛人,各种开源,也是现在大公司招聘的一个考察点, 这里介绍一下怎样把本地源码提交到github上. 首先我们需要在github上创建一个respository. 2,输 ...
- Oracle改动字段类型
因为需求变动.现要将一个类型NUMBER(8,2)的字段类型改为 char. 大体思路例如以下: 将要更改类型的字段名改名以备份.然后加入一个与要更改类型的字段名同名的字段(原字段已经改名 ...
- IOS开发之----常用的基本GDB命令【转】
原文地址:http://blog.sina.com.cn/s/blog_71715bf801016d2y.html gdb不是万能的,可是没有gdb却是万万不能的.这里给大家简单介绍下iOS开发中最基 ...
- 2016/04/18 ①注册 注册处理 ② 审核 审核处理 ③登录 登录处理 ④需要jquery-1.11.2.min.js DBDA.php
① 注册 zhuceye.php <!DOCTYPE html> <html lang="en"> <head> <meta char ...
- a simple and universal interface between web servers and web applications or frameworks: the Python Web Server Gateway Interface (WSGI).
WSGI is the Web Server Gateway Interface. It is a specification that describes how a web server comm ...
- XML简单介绍及举例
可扩展标记语言(eXtensibleMarkup Language,简称XML).是一种标记语言.标记指计算机所能理解的信息符号.通过此种标记,计算机之间能够处理包括各种信息的文章等. 怎样定义这些标 ...
- android8 Notification
界面Layout: customnotice.xml <?xml version="1.0" encoding="utf-8"?> <Li ...
- redis与spring整合·
单机版: 配置spring配置文件applicationContext.xml <?xml version="1.0" encoding="UTF-8"? ...
- 唯一性校验 impl 和 action
IMPL方法实现 // 这个方法是通过ID修改数据 如果得到结果大于0 表明结果有重复 如果得到结果小于0 表明结果正确 @Override public boolean checkVersion( ...
- Webdriver中关于driver.navigate().to()和driver.get()使用的区别
先是有一个父页上button弹开一个子页,总共有4个子页,必须前一个页上的必填信息录完,才能在这个页面触发下一个子页. 用driver.navigate().to(baseUrl2),直接跳转到第2个 ...