最近剛學Struts2+spring2+ibatis,碰到一個問題很奇怪:     我做了一個登陸模塊,開始輸入正確的用戶名和密碼,可以正常跳轉到成功的頁面,當我用一個不存在的用戶,登陸時,出錯並跳回登陸界面;出過錯之後我雙在登陸界面輸入正確的用戶名和密碼,卻無法正常登陸,tomcat也不報錯;我將整個過程打在屏幕上,發現出過錯之後再用正確的用戶登陸時沒有執行execute()方法,不知這是怎麼回事?  打出的過程如下: 資訊: Find registry server-registry.xml at classpath resource
2009/2/7 下午 04:42:39 org.apache.catalina.startup.Catalina start
資訊: Server startup in 19125 ms
Set User Name***************
2009/2/7 下午 04:43:31 com.opensymphony.xwork2.validator.ActionValidatorManagerFactory <clinit>
資訊: Detected AnnotationActionValidatorManager, initializing it...
Before Login:admin
Running Login.....................>>>>>>>>
My Login success!Set User Name***************
Before Login:yuyui
Running Login.....................>>>>>>>>
MyTest failed!Set User Name***************   打印出來發現,第二次登陸失敗後,我再輸入正確的用戶名和密碼,卻隻執行到紅色那一 行,execute()方法根本沒執行,不知哪的問題?以下是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 default-autowire="autodetect">
   
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost/store</value>
</property>
<property name="username">
<value>store</value>
</property>
<property name="password">
<value>store</value>
</property>
</bean>


<!-- spring的ibatis 配制 -->
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="WEB-INF/SqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />
</bean>

<!-- spring 的事务处理类配置 -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>

<!-- 实体DAO类  -->
<bean id="userDAO" class="com.caitou.dao.UserDAO">
<property name="sqlMapClient">
<ref local="sqlMapClient" />
</property>
</bean>
<!-- 業務處理類-->
<bean id="userService" class="com.caitou.service.UserServiceImpl" >
<property name="userDao">
    <ref bean="userDAO"/>
</property>
</bean>

<!-- Struts2 action类 -->
<bean id="Login" class="com.caitou.actions.HelloWorld" >
<property name="myuserservice" ref="userService" />
<!--ref bean="userDAOProxy"/>
</property-->
</bean>

<!--事務攔截器-->
<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> 
<property name="transactionManager"> 
<ref local="transactionManager" /> 
</property> 
<property name="transactionAttributes"> 
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
</props> 
</property> 
</bean> 

<!--定義BeanNameAutoProxyCreator-->    
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>userService</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>transactionInterceptor</value> 
</list>
</property>
</bean>
 </beans>