=================struts-config.xml======================<struts-config>
<data-sources />
<form-beans >
<form-bean name="loginForm" type="com.test.struts.form.LoginForm" /> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="indexForword" path="/index.jsp" />
</action> </action-mappings> <message-resources parameter="com.test.struts.ApplicationResources" />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
</plug-in>
</struts-config>
==========================================applicationContext.xml==================<beans>
<bean name="/login" class="com.test.struts.action.LoginAction" singleton="false">
<property name="userDao">
<ref bean="userDAOProxy" />
</property>
</bean> <bean id="dateSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306/mysql">
</property>
<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dateSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/test/model/UserTable.hbm.xml</value></list>
</property></bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="userDao" class="com.test.Dao.Imp.UserDaoImp" >
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="userDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="userDao" />
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="is*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
</beans>请各位帮忙,谢谢啦~~!搞了一天了,头都晕了!!
<data-sources />
<form-beans >
<form-bean name="loginForm" type="com.test.struts.form.LoginForm" /> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="indexForword" path="/index.jsp" />
</action> </action-mappings> <message-resources parameter="com.test.struts.ApplicationResources" />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
</plug-in>
</struts-config>
==========================================applicationContext.xml==================<beans>
<bean name="/login" class="com.test.struts.action.LoginAction" singleton="false">
<property name="userDao">
<ref bean="userDAOProxy" />
</property>
</bean> <bean id="dateSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306/mysql">
</property>
<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dateSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/test/model/UserTable.hbm.xml</value></list>
</property></bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="userDao" class="com.test.Dao.Imp.UserDaoImp" >
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="userDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="userDao" />
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="is*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
</beans>请各位帮忙,谢谢啦~~!搞了一天了,头都晕了!!
解决方案 »
- 请教--开机怎么自动运行java程序
- 通过id获得实体类
- 我导出PDF文件有两页,怎么在第二页指定位置添加复选框?大家帮帮小弟@!!
- 帮帮忙 翻译代码 ruby 那边人太少了~~
- jsp中连数据库的问题--ResultSet rs=stmt.executeQuery(sql);不起作用---不能跳到指定页面
- 那位高手能指点一下~~~ 多谢了
- 采用Hibernate对分属不同数据库中的两个表批量插入操作
- 遇上了这种错误怎么解决????
- 行数统计器程序需求 请高手帮忙
- 错误信息为java.sql.SQLException: No suitable driver,怎样解决?
- 关于struts2的包含问题
- hibernate关系映射 困惑中
也可以搜索.class文件,按照名称排序,就可以看到所有重复的class了