zoukankan      html  css  js  c++  java
  • Spring 配置自动扫描spring bean配置

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/tx 
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/aop 
        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
        default-autowire="byName" default-lazy-init="true">
    
        <context:annotation-config />
        <context:component-scan base-package="com.wolfgang"></context:component-scan>

    这样在类中

    @Service("xxx")

    写在service类的类定义上面,注入dao的地方

    @Resource

    private IxxxDao xxdao

    在IxxxDao接口实现的类定义上方,写上

    @Repository("xxdao")

    xxxDaoImpl implements IXXXDao

  • 相关阅读:
    机器学习-正则化方法
    机器学习-回归算法
    机器学习算法一
    机器学习概览
    tensorflow机器学习初接触
    tensorflow决策树初接触
    tensorflow语法
    tensorflow第一个例子简单实用
    Hyperledger Fabric 1.0架构入门
    结合《XXXX需求征集系统》分析可用性和可修改性战术
  • 原文地址:https://www.cnblogs.com/unixshell/p/3417212.html
Copyright © 2011-2022 走看看