zoukankan      html  css  js  c++  java
  • struts2 action 之间的跳转

    从action1直接跳转到action2,有两种方法: 

    1. 需要保存前一个action的属性信息时使用,保存住action1的request对象: 
         <result type= "chain " name="a2">action2</result>  此处 action2 指action名称,无须带.action 或者.do
    2. 不保存前一个action的参数可以用这种方法: 
          <result  type= "redirectAction "> action2</result> 这个就需要 带上.action 名称

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
    <struts>
        <package name="chemical" namespace="/chemical" extends="global">
            <action name="*" class="com.sinocarbon.tbl.action.ChemicalAction" method="{1}">
                <!--原材料输入输出-->
                <result name="addRawmaterial">/entp_pages/chemical/rawmaterial.jsp</result>
                <!--<result name="toEditRawmaterial" type="redirectAction">toEditRawmaterial.action?tblcode=12&amp;reptid=3</result>-->
                <result name="toEditRawmaterial" type="chain">toEditRawmaterial</result>
                
                <!--碳酸盐使用过程产生的排放-->
                <result name="addCarbonate" >/entp_pages/chemical/carbonate.jsp</result>
                <result name="toEditCarbonate" type="chain">toEditCarbonate</result>
                
                <!--硝酸生产过程产生的排放-->
                <result name="addNitricacid">/entp_pages/chemical/nitricacid.jsp</result>
                <result name="toEditNitricacid" type="chain">toEditNitricacid</result>
                
                <!--已二酸生产过程产生的排放-->
                <result name="addAdipicacid">/entp_pages/chemical/adipicacid.jsp</result>
                <result name="toEditAdipicacid" type="chain">toEditAdipicacid</result>
                
                <!--回收外供的二氧化碳-->
                <result name="addSupplyco2">/entp_pages/chemical/supplyco2.jsp</result>
                <result name="toEditSupplyco2" type="chain">toEditSupplyco2</result>
                
                <result name="editRawmaterial">/entp_pages/chemical/editRawmaterial.jsp</result>
                <result name="editCarbonate">/entp_pages/chemical/editCarbonate.jsp</result>
                <result name="editNitricacid">/entp_pages/chemical/editNitricacid.jsp</result>
            </action>
        </package>
    </struts>
  • 相关阅读:
    打印沙漏
    秋季学期学习总结
    bzoj1059[ZJOI2007]矩阵游戏 二分图匹配
    bzoj1055[HAOI2008]玩具取名 区间dp
    bzoj1053[HAOI2007]反素数ant
    bzoj1049[HAOI2006]数字序列
    bzoj1046[HAOI2007]上升序列
    bzoj1044[HAOI2008]木棍分割 单调队列优化dp
    bzoj3930[CQOI2015]选数 容斥原理
    bzoj1069 [SCOI2007]最大土地面积 旋转卡壳
  • 原文地址:https://www.cnblogs.com/spp0152/p/4566947.html
Copyright © 2011-2022 走看看