官網: spring.iojava
接口文檔: spring.apiweb
1 public static void main(String[] args) { 2 // 初始化和啓動(註解) 3 AnnotationConfigApplicationContext acaContext = new AnnotationConfigApplicationContext(AppConfig.class); 4 // 運行 5 acaContext.getBean(HjBean.class); 6 // 關閉/銷燬 7 acaContext.close(); 8 }
spring主要核心就是IOC與AOP,經過高度的可配置性來下降耦合.spring
spring-core:Spring中的核心工具類包;數據庫
spring-beans:Spring中定義bean的組件;express
spring-context:Spring的運行容器;編程
spring-context-support:Spring容器的擴展支持;api
spring-expression:Spring的表達式語言支持;spring-mvc
spring-aop:基於代理的AOP支持;websocket
spring-aspects:集成Aspects的AOP支持;mvc
spring-web:提供web的基礎功能;
spring-webmvc:提供springmvc的功能;
spring-websocket:提供web socket支持;
spring-webmvc-portlet:提供Portlet環境的支持;
spring-jdbc:提供對jdbc鏈接的封裝功能;
spring-tx:提供對事務的支持;
spring-orm:提供對象-關係映射支持;
spring-oxm:提供對象-XML映射支持;
spring-jms:提供消息隊列的支持;
spring-test:提供對測試功能的支持.