日期:2014-05-18 浏览次数:20768 次
@Controller
public class LoginAction{
@Autowired
private LoginService loginService;
@Service
public class LoginServiceImpl implements LoginService {
@Autowired
private RoleDao roleDao;
@Repository
public class RoleDaoImpl implements RoleDao {
@Autowired
private SessionFactory sessionFactory;
@Autowired
private BaseDao baseDao;
@Repository
public class BaseDaoImpl implements BaseDao{
@Autowired
private SessionFactory sessionFactory;
<!--对web包中的所有类进行扫描,以完成Bean创建和自动依赖注入的功能 -->
<context:component-scan base-package="com.mvc.java">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<context:component-scan base-package="com.mvc.base">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>