配置如下:struts-config.xml<action-mappings >
    <action path="/test" type="org.springframework.web.struts.DelegatingActionProxy">
      <forward name="head" path="/head.jsp" />
      <forward name="error" path="/error.jsp" />
    </action>
  </action-mappings>
<controller>
<set-property property="processorClass"
        value="org.springframework.web.struts.DelegatingRequestProcessor" />
</controller>
<message-resources parameter="netstore.ApplicationResources" />
 <plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml" />
 </plug-in>
applicationContext.xml
<bean name="/test" class="action.TestAction">
    </bean>head.jsp
<form name="login" action="test.do">
<table>
<tr  class="logintitle1">
<td>用户名<font color="red">*</font><input type="text" name="username"/></td>
<td><input type="submit" value="登录" onclick="return validate()"/></td>   
</tr>
</form>testAction
public class TestAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
   return  mapping.findForward("error");
}

解决方案 »

  1.   

    楼主貌似将几种方法都给综合了,只要选择一种方法就行了。
    比如说只在struts配置文件中添加<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />
    并且所有action的类保持原样应该就可以了
      

  2.   

    这个网上教程实在很多,LZ把异常发出来看看http://www.blogjava.net/oksonic/archive/2005/11/06/18370.html
      

  3.   

    异常是404错误,test.do 不可用。
      

  4.   

    Servlet action is not available,
    楼上的意思是jar包的问题吗?我引入spring,spring-mock,spring—aspects这几个jar包
      

  5.   

    <action path="/test" type="org.springframework.web.struts.DelegatingActionProxy"> 
        <forward name="head" path="/head.jsp" /> 
        <forward name="error" path="/error.jsp" /> 
    </action>

    楼主看看这里,action没有name属性,这样Struts怎么会找到ActionForm进行操作呢?
      

  6.   

    我不用ActionForm,只是想知道简单的整合步骤。
    testAction 
    public class TestAction extends  DispatchAction { public ActionForward execute(ActionMapping mapping, ActionForm form, 
    HttpServletRequest request, HttpServletResponse response) { 
      return  mapping.findForward("error"); 
    }
    还是不行,但我把spring撤下去,可以正常运行。
      

  7.   

    type Status reportmessage /testtestAction.dodescription The requested resource (/testAction.do) is not available.
    web.xml  我没有更改。
      

  8.   

    少包了吧,如果是spring2.5的话,应该引入包spring-webmvc-struts.jar,在spring/dist/modules中web.xml  <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
      </context-param>
      

  9.   

    噢,上面的web.xml中不用加,如果在struts-config.xml中配置了那么就不用在web.xml中在配置了
      

  10.   

    我测试可以啊!<td> <input type="submit" value="登录" onclick="return validate()"/> </td>  这里换成:type = "button" 试下,我的配置没有你复杂,
    <struts-config>
    <action-mappings>
                <action path="/test" 
        type="org.springframework.web.struts.DelegatingActionProxy" 
    >
        <forward name="error" path="/error.jsp" />

    </action>
    </action-mappings>

    <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
    <set-property property="contextConfigLocation"
    value="/WEB-INF/classes/applicationContext.xml" />
    </plug-in>

    </struts-config>
      

  11.   

    呵呵,谢谢各位的关注与支持,问题解决了。
    是jar包冲突了,当然也有配置多种方法引起的混乱。谢谢,结贴。