<?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 模板的更多相关文章

  1. ApplicationContext.xml模板

      <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www. ...

  2. spring applicationContext.xml详解及模板

    applicationContext.xml 文件   1.<context:component-scan base-package="com.eduoinfo.finances.ba ...

  3. applicationContext.xml简单笔记

    applicationContext.xml简单笔记 <?xml version="1.0" encoding="UTF-8"?> <bean ...

  4. applicationContext-mail.xml 模板

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  5. applicationContext.xml配置简介

    这里简单介绍一下spring的配置文件applicationContext.xml中的一些配置的作用. <context:component-scan base-package="&q ...

  6. spring applicationContext.xml和hibernate.cfg.xml设置

    applicationContext.xml配置 <?xml version="1.0" encoding="UTF-8"?> <beans ...

  7. 为什么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 ...

  8. 项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]

    记录一下: org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing org.s ...

  9. web.xml配置错误导致applicationContext.xml配置重复加载

    web.xml相关配置 <context-param><param-name>log4jRefreshInterval</param-name><param- ...

随机推荐

  1. 自动化测试基础篇--Selenium中JS处理滚动条

    摘自https://www.cnblogs.com/sanzangTst/p/7692285.html 前言 什么是JS? JS就是JavaScript: JavaScript 是世界上最流行的脚本语 ...

  2. JSON Web Tokens简单学习

    JWT用于加密生成安全认证的令牌,存储登录验证成功的部分用户信息 一.安装JWT 二.加密 解密 代码 /*存储在加密字符串的信息*/ var payload = new Dictionary< ...

  3. centos下mysql授予权限提示ERROR 1133 (42000): Can't find any matching row in the user table

    错误: 给mysql对应的用户授予权限的时候提示报错: 解决方法: 后面才知道原来是同事这边新增了用户没有flush grant all privileges on *.* to 'user'@'%' ...

  4. php学习----运算符

    PHP 1.运算符 加减乘除与数学运算无异 但PHP的赋值运算符有两种,分别是: (1)"=":把右边表达式的值赋给左边的运算数.它将右边表达式值复制一份,交给左边的运算数.换而言 ...

  5. #000 Python 入门第一题通过扩展,学到了更多的知识

    #1写在前面的话 我觉得这样学习或许能够在学习的过程中事半功倍 第一道简单的python编写代码输出10行带标号的“Hello,world.”,具体效果参阅输入输出示例 1:Hello,world. ...

  6. 阿里八八Beta冲刺博客集合贴

    Scrum 阿里八八β阶段Scrum(1/5) 阿里八八β阶段Scrum(2/5) 阿里八八β阶段Scrum(3/5) 阿里八八β阶段Scrum(4/5) 阿里八八β阶段Scrum(5/5) 总结 阿 ...

  7. 监听器的配置,绑定HttpSessionListener监听器的使用

    监听器的配置,绑定 <listener> <listener-class>监听器的全路径</listener-class> </listener> Se ...

  8. 获取WebApplicationContext的几种方式

    加载WebApplicationContext的方式 WebApplicationContext是ApplicationContext的子接口,纵观Spring框架的几种容器,BeanFactory作 ...

  9. 想要快速上手 Spring Boot?看这些教程就足够了!

    1.项目名称:分布式敏捷开发系统架构 项目简介:基于 Spring + SpringMVC + Mybatis 分布式敏捷开发系统架构,提供整套公共微服务服务模块:集中权限管理(单点登录).内容管理. ...

  10. iptables 端口转发规则

    玩 vps 的经常要用到端口转发用以实现更快的速度.比如 ovh 机房的网络我这里访问非常慢,用远程桌面会吐血的类型.所以就会用其他的线路作为跳板,比如洛杉矶,香港之类的.再比如如果需要一个日本 ip ...