解决方案 »

  1.   

    先看看走没走action,一般配置跳转jsp都要加'/'的,比如“/WEB-INF/1.jsp”
      

  2.   

    应该是你的result配置有问题吧,你再试下看看路径对不对
      

  3.   

     <result name="ensure" >/commit.jsp</result>   
            <result name="view" >/view.jsp</result>   
      

  4.   

    你把   public String execute() throws Exception{}方法注释了啊,你在form里都写了两个方法了,action直接执行你写的方法,如果还加execute() 方法,就是执行完你自己的方法在执行execute() ,但是execute() 的action没有配置对应的响应,你只配置了你自己的两个方法的action。
      

  5.   

    不知道楼主struts2配置文件中这句话有没有加?如果没有加默认是执行execute方法
     <constant name="struts.enable.DynamicMethodInvocation" value="true"/>
      

  6.   

    <s:submit>好像没有method属性把?一个表单的action要不在form中,要不你就写两个button用js来进行判断,document.getElementById("x1").action="userAction!ensure";
    document.getElementById("x2").action="userAction!view";
    document.getElementById("x1").submit();
    document.getElementById("x2").submit();配置文件应该加一个动态调用
    <constant name="struts.enable.DynamicMethodInvocation" value="true" />
    或者用通配符的方式(具体自己百度)
    <action name="xxx_*" class="xxx" method="{1}">
      

  7.   

    你在action中对应的方法上定个断点看看  能进方法不。。  要是可以进就是result配置有问题   要是不可以进就是其他的配置有问题不过也是struts的配置问题
      

  8.   

    1.不知道楼主struts2配置文件中有没有加以下这句话?
     <constant name="struts.enable.DynamicMethodInvocation" value="true"/>
    如果没有加默认是执行execute方法
    2.<s:submit>没有method属性吧?
    一个表单的action要不在form中,要不你就写两个button用js来进行判断
    3.一般配置跳转jsp都要加'/'的
    <result name="ensure" >/commit.jsp</result>   
     <result name="view" >/view.jsp</result>