关于使用Spring bean时报空指针异常

已经犯过无数次了,还是不长记性!

要想使用Spring容器的组件必须,加上component注解,且在使用时,不能new,必须交给Spring容器托管

你可能感兴趣的:(Spring)