@value注解取不到值

1.使用@Value注解,必须把使用类加入spring的容器管理,即在类上加上@Controller @Service @Component 等容器注解

2.使用@Value的类在调用的时候,不能直接通过new操作符进行调用,需要使用@Autowired进行注入