读书人

求救:ssh下的Servlet action is not

发布时间: 2012-02-14 19:19:19 作者: rapoo

求救:ssh下的Servlet action is not available问题
又是这个问题,求救啊。。各路高手帮帮小弟,感激涕零。。。。。
我的struts config是:
<?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="fileBasicInformationForm"
type="com.healthWeb.struts.form.FileBasicInformationForm" />

</form-beans>

<global-exceptions />
<global-forwards />
<action-mappings>
<action attribute="fileBasicInformationForm"
input="/fileBasicInformation.jsp" name="fileBasicInformationForm"
path="/fileBasicInformation" scope="request">
<forward name="success" path="/success.jsp" />
</action>
</action-mappings>
<controller>
<set-property property="processorClass"
value="org.springframework.web.struts.DelegatingRequestProcessor" />
</controller>
<message-resources
parameter="com.healthWeb.struts.ApplicationResources" />
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml" />
</plug-in>
</struts-config>



spring的application config是:


<?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"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
</property>
<property name="url" value="jdbc:sqlserver://localhost:1433"></property>
<property name="username" value="sa"></property>
<property name="password" value="pandonghua"></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/healthFile/vo/FileBasicInformation.hbm.xml
</value>
</list>
</property>
</bean>

<bean id="fileBasicInformationDAO"
class="com.healthFile.dao.FileBasicInformationDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>

<bean id="healthFileService" name="healthFileService"
class="com.healthFile.service.HealthFileService">
<property name="fileBasicInformationDAO">
<ref local="fileBasicInformationDAO" />
</property>
</bean>


<bean id="fileBasicInformation" name="fileBasicInformation"
class="com.healthWeb.struts.action.FileBasicInformationAction">
<property name="healthFileService">
<ref local="healthFileService" />
</property>
</bean>
</beans>



()、、、、我实在找不到什么问题了、、、知道的劳烦帮帮忙、、、



[解决办法]
<bean id="fileBasicInformation" name="fileBasicInformation"
改成<bean name="/fileBasicInformation"
[解决办法]
好像是少了什么包吧
[解决办法]
你吧Struts的Action交给Sping代理那么就应该在struts.config 文件的Action里加入
type="org.springframework.web.struts.DelegatingActionProxy
写成
<action attribute="fileBasicInformationForm"
input="/fileBasicInformation.jsp" name="fileBasicInformationForm"
path="/fileBasicInformation" scope="request"
type="org.springframework.web.struts.DelegatingActionProxy>

以及一楼的正解

读书人网 >J2EE开发

热点推荐