其实很简单,只要一个添加 @Autowired 然后调用写法:修饰符 dao类名 变量名; 不在需要new @Autowired private UserDao userDao; 转载于:https://www.cnblogs.com/hzyhx/p/11105044.html