有两个jsp页面对应一个同一个action 时,那个Input 要如何赋值?
还是把action写成两个?
<action
      attribute="scheduleForm"
      input="/pages/scheduleadd.jsp"    
      name="scheduleForm"
      path="/schedule"
      scope="request"
      type="cn.fzu.action.ScheduleAction"
      validate="false">
      <forward name="schedule" path="/pages/schedule.jsp" />
</action><action
      attribute="scheduleForm"
      input="/pages/schedule.jsp"    
      name="scheduleForm"
      path="/schedule"
      scope="request"
      type="cn.fzu.action.ScheduleAction"
      validate="false">
      <forward name="schedule_find" path="/pages/schedule_find.jsp" />
</action>
  
 当写成上面这样时,在Eclipse环境里把struts-config.xml从源码模式转换成设计模式时会出错,是不是不能写成上面这样子?
有没有什么解决方法?

解决方案 »

  1.   

    lz干嘛非要写input属性呢。<action>元素里嵌套两个<forward>子元素就可以了。
      

  2.   

    两个action的path都一样 改成schedule1 schedule2就可以了
      

  3.   

    一楼的意思是下面这样吗?把input属性去掉,  (但每次提交不同的表单时,formBean里面的属性的值会不会重新初始化?)
    <action
          attribute="scheduleForm"  
          name="scheduleForm"
          path="/schedule"
          scope="request"
          type="cn.fzu.action.ScheduleAction"
          validate="false">
          <forward name="schedule" path="/pages/schedule.jsp" />
          <forward name="schedule_find" path="/pages/schedule_find.jsp" />
        </action>
    这样可以吗?还有二楼是不是下面这个意思?
    <action
          attribute="scheduleForm"
          input="/pages/scheduleadd.jsp"    
          name="scheduleForm"
          path="/schedule1"
          scope="request"
          type="cn.fzu.action.ScheduleAction"
          validate="false">
          <forward name="schedule" path="/pages/schedule.jsp" />
    </action><action
          attribute="scheduleForm"
          input="/pages/schedule.jsp"    
          name="scheduleForm"
          path="/schedule2"
          scope="request"
          type="cn.fzu.action.ScheduleAction"
          validate="false">
          <forward name="schedule_find" path="/pages/schedule_find.jsp" />
    </action>
      

  4.   

    action?? 是form 的action吗?  怎么这么多属性啊
      

  5.   

    你validate都等于false了
    就不用input来返回出错跳转页面了呀
    直接把input都去掉