SSH整合問題
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="DataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="url">
<value>
jdbc:microsoft:sqlserver://pch:1433;DatabaseName=Mold_Manage07
</value>
</property>
<property name="username">
<value>05022409</value>
</property>
<property name="password">
<value>05022409</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>
<prop key="show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/sb/mmg/db/Usertab.hbm.xml</value></list>
</property></bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"
abstract="false" singleton="true" lazy-init="default"
autowire="default" dependency-check="default">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="UsertabDAO" class="com.sb.mmg.db.UsertabDAO">
<property name="sessionFactory">
<ref bean="SessionFactory" />
</property>
</bean>
<bean name="/login" class="com.sb.mmg.struts.action.LoginAction"
abstract="false" singleton="false" lazy-init="default"
autowire="default" dependency-check="default">
<property name="userdao">
<ref bean="UsertabDAO" />
</property>
</bean></beans>
struts-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources />
<form-beans>
<form-bean name="loginForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="password" type="java.lang.String"></form-property>
<form-property name="username" type="java.lang.String"></form-property>
</form-bean>
</form-beans>
<global-exceptions />
<global-forwards>
<forward name="indexGo" path="/success.jsp"/>
</global-forwards>
<action-mappings >
<action
attribute="loginForm"
input="/index.jsp"