Spring-메모 컨트롤 소개

1412 단어
1、@controller    (    )
2、@service   (  dao)
3、@repository dao(  dao  )
4、@component (   pojo    spring   ,         <bean id="" class=""/>)

@Component,@Service,@Controller,@Repository , spring 。 
        component      
<context:component-scan base-package=”com.mmnc”>    
  base-package       (     ) 
       1、@Service  
       2、@Controller ( struts action) 
       3、@Repository , DAO . 
       4、@Component , , 。 
   
@Service 
public class UserServiceImpl implements UserService { } 
@Repository 
public class UserDaoImpl implements UserDao { } 

 
getBean        (     ),      ,  @Service(“***”)               
, bean , , @Service(“beanName”) 
@Scope(“prototype”)
。 ( ):
@PostConstruct 
public void init() { } 

좋은 웹페이지 즐겨찾기