Skip to content

Instantly share code, notes, and snippets.

@hsipeng
Created July 3, 2017 02:00
Show Gist options
  • Save hsipeng/c0e71239a7f8713007bb9fcc4c1bfa28 to your computer and use it in GitHub Desktop.
Save hsipeng/c0e71239a7f8713007bb9fcc4c1bfa28 to your computer and use it in GitHub Desktop.
Spring applicationContext.xml 文件头
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- id 唯一标识这个bean,不能重复
id遵循驼峰命名规则
class对象的具体路径,从package开始
-->
<bean id="hello" class="beans.Hello"></bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment