●●●在线等 spring提示和我配置不符,我该怎么办?●●●
Java code<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" [color=#FF0000]class="org.apache.commons.dbcp.BasicDataSource">[/color] <property name="driverClassName" value="com.mysql.jdbc.Driver"> </property> <property name="url" value="jdbc:mysql://localhost:3306/mytest"> </property> <property name="username" value="root"></property> <property name="password" value=""></property> </bean> <!-- 一配置id 为dataSource 的bean,该bean 是个数据源实例一<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> </property> <property name="url"> <value>jdbc:mysql://localhost:3306/mytest</value> </property> <property name="username"> <value>root</value> </property> <property name="password"> <value></value> </property></bean> --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.SQLServerDialect </prop> </props> </property> <property name="mappingResources"> <list> <value> com/soulab/mybbs/beans/MybbsForums.hbm.xml </value> <value> com/soulab/mybbs/beans/MybbsGroups.hbm.xml </value> <value>com/soulab/mybbs/beans/MybbsPosts.hbm.xml</value> <value> com/soulab/mybbs/beans/MybbsThreads.hbm.xml </value> <value>com/soulab/mybbs/beans/MybbsUsers.hbm.xml</value> <value> com/soulab/mybbs/beans/ForumViewIndex.hbm.xml </value> <value> com/soulab/mybbs/beans/PostViewViewthread.hbm.xml </value> <value> com/soulab/mybbs/beans/ThreadViewForumdisplay.hbm.xml </value> </list> </property> </bean> <bean id="mybbsForumsDAO" class="com.soulab.mybbs.daos.MybbsForumsDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="mybbsGroupsDAO" class="com.soulab.mybbs.daos.MybbsGroupsDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="mybbsPostsDAO" class="com.soulab.mybbs.daos.MybbsPostsDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="mybbsThreadsDAO" class="com.soulab.mybbs.daos.MybbsThreadsDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="mybbsUsersDAO" class="com.soulab.mybbs.daos.MybbsUsersDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="forumViewIndexDAO" class="com.soulab.mybbs.daos.ForumViewIndexDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="postViewViewthreadDAO" class="com.soulab.mybbs.daos.PostViewViewthreadDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="threadViewForumdisplayDAO" class="com.soulab.mybbs.daos.ThreadViewForumdisplayDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean name="/getIndexView" class="com.soulab.mybbs.struts.action.GetIndexViewAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> <property name="fd"> <ref local="mybbsForumsDAO" /> </property> <property name="td"> <ref local="mybbsThreadsDAO" /> </property> </bean> <bean name="/getForumdisplayView" class="com.soulab.mybbs.struts.action.GetForumdisplayViewAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> <property name="fd"> <ref local="mybbsForumsDAO" /> </property> <property name="td"> <ref local="mybbsThreadsDAO" /> </property> </bean> <bean name="/getViewthreadView" class="com.soulab.mybbs.struts.action.GetViewthreadViewAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> <property name="fd"> <ref local="mybbsForumsDAO" /> </property> <property name="td"> <ref local="mybbsThreadsDAO" /> </property> <property name="pd"> <ref local="mybbsPostsDAO" /> </property> <property name="gd"> <ref local="mybbsGroupsDAO" /> </property> </bean> <bean name="/checkSameName" class="com.soulab.mybbs.struts.action.CheckSameNameAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> </bean> <bean name="/regist" class="com.soulab.mybbs.struts.action.RegistAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> <property name="gd"> <ref local="mybbsGroupsDAO" /> </property> </bean> <bean name="/login" class="com.soulab.mybbs.struts.action.LoginAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> </bean> <bean name="/newThread" class="com.soulab.mybbs.struts.action.NewThreadAction"> <property name="td"> <ref local="mybbsThreadsDAO" /> </property> </bean> <bean name="/clickThread" class="com.soulab.mybbs.struts.action.ClickThreadAction"> <property name="td"> <ref local="mybbsThreadsDAO" /> </property> </bean> <bean name="/newPost" class="com.soulab.mybbs.struts.action.NewPostAction"> <property name="pd"> <ref local="mybbsPostsDAO" /> </property> </bean> <bean name="/delpost" class="com.soulab.mybbs.struts.action.DelpostAction"> <property name="pd"> <ref local="mybbsPostsDAO" /> </property> </bean> <bean name="/searchUser" class="com.soulab.mybbs.struts.action.SearchUserAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> </bean> <bean name="/getGroups" class="com.soulab.mybbs.struts.action.GetGroupsAction"> <property name="gd"> <ref local="mybbsGroupsDAO" /> </property> </bean> <bean name="/updateUserInfo" class="com.soulab.mybbs.struts.action.UpdateUserInfoAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> </bean> <bean name="/addForum" class="com.soulab.mybbs.struts.action.AddForumAction"> <property name="fd"> <ref local="mybbsForumsDAO" /> </property> </bean> <bean name="/delForum" class="com.soulab.mybbs.struts.action.DelForumAction"> <property name="fd"> <ref local="mybbsForumsDAO" /> </property> <property name="pd"> <ref local="mybbsPostsDAO" /> </property> </bean> <bean name="/getTargetForum" class="com.soulab.mybbs.struts.action.GetTargetForumAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> <property name="fd"> <ref local="mybbsForumsDAO" /> </property> <property name="td"> <ref local="mybbsThreadsDAO" /> </property> </bean> <bean name="/updateForum" class="com.soulab.mybbs.struts.action.UpdateForumAction"> <property name="ud"> <ref local="mybbsUsersDAO" /> </property> <property name="fd"> <ref local="mybbsForumsDAO" /> </property> </bean></beans>