applicationContext.xml 模板
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-4.3.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.3.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
</beans>
<!------------------------------上面就是模板-----------------------------> <?xml version="1.0" encoding="UTF-8"?
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-4.3.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.3.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <!-- 就回去扫描这个包 看哪些类有@Component注解.... 然后就会自动加入到ioc容器中 -->
<context:component-scan base-package="包名"></context:component-scan> <bean id="" class="类的完整路径(包名+类名)"></bean> <!-- 使用默认构造函数 -->
<!-- 有几个属性就写几个<property> -->
<bean id="" class="">
<property name="" value=""></property> <!-- 默认调用 set() -->
<!-- 两种方式都可以
<property name="">
<value></value>
</property>
-->
</bean> <!-- 有几个constructor-arg 就回去调用相应的 构造函数 尽量吧name(属性名)属性写上 -->
<bean id="" class="">
<constructor-arg name="" value=""></constructor-arg>
</bean> <!-- p 命名空间 -->
<bean id="" class="“ p:属性="属性值"></bean> <!-- aop -->
<bean id="addStudent" class="com.service.AddStudent"></bean>
<bean id="logBefore" class="com.aop.LogBefore"></bean>
<aop:config>
<!-- expression里面是普通具体的普通方法 包+类+参数类型的具体类
expression=""可以写多个 e.g.
expression="execution( ) or execution()"
-->
<aop:pointcut expression="execution(public void com.service.AddStudent.addStudent())" id="pointcut"/> <!-- 切点 -->
<aop:advisor advice-ref="logBefore" pointcut-ref="pointcut"/> <!-- 切面 连接 -->
</aop:config>
</beans>
applicationContext.xml 模板的更多相关文章
- ApplicationContext.xml模板
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www. ...
- spring applicationContext.xml详解及模板
applicationContext.xml 文件 1.<context:component-scan base-package="com.eduoinfo.finances.ba ...
- applicationContext.xml简单笔记
applicationContext.xml简单笔记 <?xml version="1.0" encoding="UTF-8"?> <bean ...
- applicationContext-mail.xml 模板
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- applicationContext.xml配置简介
这里简单介绍一下spring的配置文件applicationContext.xml中的一些配置的作用. <context:component-scan base-package="&q ...
- spring applicationContext.xml和hibernate.cfg.xml设置
applicationContext.xml配置 <?xml version="1.0" encoding="UTF-8"?> <beans ...
- 为什么applicationContext.xml和spring-servlet.xml中都有注解过滤<context:component-scan base-package="myproject"> 和<context:component-scan base-package="myproject.controller" />
在刚学习SpringMVC框架整合时,你也许会产生疑问为什么Spring.xml和SpringMVC.xml中都有注解过滤. <context:component-scan base-packa ...
- 项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]
记录一下: org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing org.s ...
- web.xml配置错误导致applicationContext.xml配置重复加载
web.xml相关配置 <context-param><param-name>log4jRefreshInterval</param-name><param- ...
随机推荐
- MYSQL主从同步/主主同步
一.MYSQL主从同步 注意:进行主从同步操作时需要确保DB无写操作 flush tables with read lock: //全局读锁定,执行了命令之后所有库所有表都被锁定只读. 1.在主机 ...
- windows下安装mysql
windows 下安装mysql 1.先下载好 mysql5.7 版本的安装包,可以去官网自己下载,也可以从我的百度云分享 里面下载: 链接: https://pan.baidu.com/s/1VXk ...
- VS调式时出现异常,在输入法是中文状态下,输入框输入字母再回车,会造成页面关闭,vs退出调式
解决方案:关闭浏览器窗口关闭时,停止调试 .就恢复正常,无异常
- jQuery入门(1)
1.了解jQuery与JavaScript的区别 css --你的长相啦 Html --躯干 js --运动神经 jQuery就是对JavaScript的一个拓展,封装,就是让JavaScript更好 ...
- 怎么将后缀为.opt,.frm,.myd,.myi文件还原或者是导入mySQL中
其实这个问题的解决方案很简单,把这些文件连同这些文件所在的文件夹原封不动地复制到你的 mysql 文件夹下的 data 里面 (在我的电脑里面是D:\xampp\mysql\data), 然后你进my ...
- 我为什么要写 blog?
从事软件测试工作10余年,也没在网上留下些什么.最近忙着找工作,年龄上又遇到了瓶颈,发现好多工作岗位需要技术博客,正好趁这个机会,梳理一下自己的知识点,记录下来和大家一起学习探讨,共同进步.欢迎加我微 ...
- [福大软工] Z班 第12次成绩排行榜
注:本次成绩排行榜是针对结对项目二的点评分数 作业要求 http://www.cnblogs.com/easteast/p/7604534.html 评分细则 (1)有贴生成得最"好&quo ...
- html 初识
一.web请求流程模拟 python编写的简易服务器应用程序 import socket server=socket.socket() ip_port =('127.0.0.1',8080) serv ...
- own address as source address
1222.762730] br0: received packet on nbif0 with own address as source address[ 1222.769697] br0: rec ...
- Linux /var/log下的各种日志文件详解
1)/var/log/secure:记录登录系统存取数据的文件;例如:pop3,ssh,telnet,ftp等都会记录在此. 2)/var/log/wtmp:记录登录这的信息记录,被编码过,所以必须以 ...