spring的一些常用注解

来源:互联网 发布:淘宝开店起步 编辑:程序博客网 时间:2024/05/20 03:08

1、@Controller
@Controller对应表现层的Bean,也就是Action

@Controllerpublic class Controller {}

2、@ Service
@Service对应的是业务层Bean

@Servicepublic class ServiceImpl implements Service {    @Resource    private Dao dao;}

3、@ Repository
@Repository对应数据访问层Bean

@Repositorypublic class DaoImpl implements Dao {    @Resource    private JdbcTemplate jdbcTemplate;}
0 0
原创粉丝点击