注解的一个小问题,请大侠看一下啦
SSH框架 刚刚使用注解,
在action中
@Controller
@Scope("prototype")
public class RoleAction extends ActionSupport {
@Resource
private RoleSerivce roleSerivce; //RoleSerivce 是接口
在RoleServiceImpl(RoleSerivce接口的实现类)中:
@Service
@Transactional
public class RoleServiceImpl implements RoleSerivce {
请问
用Resource注解注入的时候,如果按默认名称注入,显然roleSerivce 和 roleServiceImpl 属性名称是不一样的,
只能按照属性名注入了 可是一个是 roleSerivce接口,一个是roleServiceImpl 实现类,根本不一样的类型,但是为什么就能注入上呢
求解,谢谢了