package com.itheima.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("com.itheima")
public class SpringConfig {
}
ApplicationContext ctx= new AnnotationConfigApplicationContext(SpringConfig.class);
UserService userService = (UserService) ctx.getBean("userService");
userService.save();