只需要加上这几行就行
static String paths[] = {"spring/applicationContext.xml"};
static ApplicationContext ctx = new ClassPathXmlApplicationContext(paths);
static BookService bookService = ctx.getBean(BookService.class);
只需要加上这几行就行
static String paths[] = {"spring/applicationContext.xml"};
static ApplicationContext ctx = new ClassPathXmlApplicationContext(paths);
static BookService bookService = ctx.getBean(BookService.class);