Spring notes 1
来源:互联网 发布:开源视频网站 php 编辑:程序博客网 时间:2024/06/11 05:11
DI
- xml configuration
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"Listing 1.5 SlayDragonQuest is a Quest to be injected into BraveKnightListing 1.6 Injecting a SlayDragonQuest into a BraveKnight with Springwww.it-ebooks.infoSimplifying Java development 9xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd"><bean id="knight" class="com.springinaction.knights.BraveKnight"><constructor-arg ref="quest" /></bean><bean id="quest" class="com.springinaction.knights.SlayDragonQuest"><constructor-arg value="#{T(System).out}" /></bean></beans>
- annonation
@Configurationpublic class KnightConfig {@Beanpublic Knight knight() {return new BraveKnight(quest());}@Beanpublic Quest quest() {return new SlayDragonQuest(System.out);}}
AOP
<aop:config> <aop:aspect ref="minstrel"> <aop:pointcut id="embark" expression="execution(* *.embarkOnQuest(..))"/> <aop:before pointcut-ref="embark" method="singBeforeQuest"/> <aop:after pointcut-ref="embark" method="singAfterQuest"/> </aop:aspect></aop:config>
application context
- AnnotationConfigApplicationContext—Loads a Spring application context from one or more Java-based configuration classes
- AnnotationConfigWebApplicationContext—Loads a Spring web application context from one or more Java-based configuration classes
- ClassPathXmlApplicationContext—Loads a context definition from one or more XML files located in the classpath, treating context-definition files as classpath resources
- FileSystemXmlApplicationContext—Loads a context definition from one or more XML files in the filesystem
- XmlWebApplicationContext—Loads context definitions from one or more XML files contained in a web application
0 0
- Spring notes 1
- Spring notes
- Spring Notes
- Spring Acegi notes
- Spring Scope Notes
- Spring notes 2
- MySql study notes [1]
- JVM Notes - 1
- Portlet Study Notes (1)
- TCAP Notes(1)
- C++ notes 1
- Tcl/Tk Notes (1)
- NCE 3-1 Notes
- PBRT reading notes 1
- MFC Programming Notes 1
- Notes for OpenGL - 1
- MZ Header Notes (1)
- VTune Basic Notes 1
- A - Secrete Master Plan【ccpc】
- 深入解读缓存(三)——Memcache缓存
- BestCoder Round #61 (div.2) 1002
- HDU 5523 Game(就是情况比较多,讨论全了就可以了)——BestCoder Round #61(div.1 div.2)
- linux常用基本命令
- Spring notes 1
- 继续让脑细胞嗨起来
- LightOJ - 1122 Digit Count(DP)
- UDK BaseTools
- ADO
- 方法的重载
- L - Huatuo's Medicine【ccpc】
- 对着阳光笑了笑
- Boostrap实现仿百度百科当前页快捷导航栏效果