代碼:
application context AC = new file systemxmlaplicationcontext(" application context . XML ");
AC . get bean(" beanId ");
描述:
這種方法適合使用Spring框架的獨立應用,需要程序通過配置文件手動初始化Spring。