<bean id="UserinfoDao" class="com.cnc.ssm.dao. UserinfoDaoImpl">
        <property name="sessionFactory">
            <ref local="sessionFactory"/>
        </property>
    </bean>
在spring配置文件中仿照这样的进行配置,就等于把UserinfoDao注入了啊,然后你就可以用UserinfoDao了