28-33

28-33,第1张

28-33
package com.itheima.annotation; 
public interface UserDao { 
	public void save();
}
package com.itheima.annotation;
import org.springframework,stereotype.Repository; @Repository("userDao")
public class UserDaoImpl implements userDao(
	public void save(){
		System.out.println("userdao...save...");
"package"com.itheima:annotation;
public interface UserService (
	public void save();
package com.itheima.annotation;
import javax.annotation.Resource;
import org.springframework.stereotype Service;
@Service ("userService") 
public class UserServicelmpl implements UserService{ 					@Resource(name-"userpag")
	private UserDao userDao; 
	public void save() {
	this.userDao.save();
	System.out.print("userservice...save...");
	}
}
package com.itheima.annotation;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller; @Contzoller("userController") 
public class UserController {
	@Resource(name="usezService") 
	private Userservice userService; 
	public void save(){
		this.userService.save();
		System.out.println("userController...save...");
	}
}



<!一分别定义 3 个 Bean 实例质> 
 


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5612575.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存