又见找不到antion问题,请各位给个意见嘛
在整合SSH的时候出现了找不到ACTION问题,TOMCAT没有报任何错误,所以一直没解决这个问题
首先我整合SPRING和HIBERNATE是成功的,可以通过
ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
取出数据库中的值
但是在整合SPRING和STRUTS的时候出现了问题
首先我的struts配置文件如下:
<struts-config>
<form-beans />
<action-mappings>
<action path="/execute" parameter="execute">
<forward name="fail" path="/fail.jsp"></forward>
</action>
</action-mappings>
<!-- Spring整合Struts引用的类(不做修改) -->
<controller>
<set-property property="processorClass"
value="org.springframework.web.struts.DelegatingRequestProcessor" />
</controller>
<message-resources parameter="com.andy.struts.ApplicationResources" />
<!-- Struts指定Spring配置文件的路径 -->
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml" />
</plug-in>
</struts-config>
spring文件配置如下:
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver">
</property>
<property name="url" value="jdbc:mysql://127.0.0.1:3306/financial">
</property>
<property name="username" value="root"></property>
<property name="password" value="andy"></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.MySQLDialect
</prop>
</props>
</property>
</bean>
<bean name="/execute" class="com.andy.action.SystemAction"
abstract="false" lazy-init="default" autowire="default"
dependency-check="default">
</bean>
</beans>
我现在根本没做任何数据操作,只是让页面进行跳转,但是这个时候他就会报找不到action,但是当我把spring文件中的"sessionFactory" bean去掉之后就可以找到action了,请问大家有没有遇到过这种问题呢?