搭了个小demo,工程启动后,点击页面提交按钮,没有任何反应,也没有报错,如下所示:web.xml:<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  <context-param>
<param-name>contextConfigLocation</param-name>     
<param-value>/WEB-INF/applicationContext.xml</param-value>
  </context-param>     
  <listener>   
   <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>     
  </listener>
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>3</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>3</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>
struts-config.xml:
<struts-config>
  <global-exceptions />
  <global-forwards />
  <action-mappings>
  <action path="/testAction"
type="org.springframework.web.struts.DelegatingActionProxy"
   parameter="reqCode" 
scope="request">
<forward name="kao"
path="/qwe.jsp" />
 </action>
  </action-mappings>
  <message-resources parameter="ApplicationResources" />
  <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">      
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml"/>
</plug-in>
</struts-config>
applicationContext.xml:
<beans>
<bean name="/testAction" class="test.struts.action.mytest"/>
</beans>jsp:
<form action="testAction.do?reqCode=test" method="post">
    <table>
    <tr>
    <td>
    <input type="submit" value="点 它">
    </td>
    </tr>
    </table>
    </form>
请指教!!!

解决方案 »

  1.   

    <bean name="/testAction" class="test.struts.action.mytest"/> 
    看看你的mytest怎么写的?
    为什么你的类首字母是小写呢?~~~<form action="testAction.do?reqCode=test" method="post"> 
    还有一种可能是你form的action写法 如果是post提交 ?后面的参数可能会忽略的
    最好是放在隐藏域在form中 
      

  2.   

    Mytest:public class Mytest extends Action{
    public ActionForward test(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse servletResponse) {
    System.out.println("ok");
    return mapping.findForward("ko");

    }
    }
    写错了,是大写<bean name="/testAction" class="test.struts.action.Mytest"/> 点击按钮后,url为http://localhost:8080/test/testAction.do?reqCode=test
    其它就没有任何反应了,没有输出 ok!
      

  3.   

    System.out.println("ok"); 
    你这样输出ok不是在页面 你看看你控制台有没有
      

  4.   

    多搞点日至出来,现场出了问题都是发日至回来的,要不只有现象和说明研发也只能猜测,所以一定要把控制台的东西发下来啊 
    调试js就一段段的alert 早晚能alert出来吧
      

  5.   

    jsp: 
    <form action="testAction.do?reqCode=test" method="post"> 
        <table> 
        <tr> 
        <td> 
        <input type="submit" value="点 它"> 
        </td> 
        </tr> 
        </table> 
        </form> 很久没看过JSP前台代码了,你看看是不是有问题呢 ?
    特别是form里面的内容,怀疑请求没有被提交
      

  6.   

      你没有使用DispatchAction就不要改变action中的默认方法execute的方法名字!你这里改回去下,用execute..请求的路径,直接用action="testAction.do" 配置文件中的 parameter="reqCode" 也不需要!!
      

  7.   

    应该是lin364653705说的这种情况,我在试试
      

  8.   

    ok,搞定,就是DispatchAction的原因,谢谢各位!