zoukankan      html  css  js  c++  java
  • Struts2 Result Type

    1、struts.xml

    <struts> 
     <constant name="struts.devMode" value="true" />
     <package name="resultTypes" namespace="/r" extends="struts-default">
            
            <action name="r1">
                <result type="dispatcher">/r1.jsp</result>
            </action>
            <action name="r2">
                <result type="redirect">/r2.jsp</result>
            </action>
            <action name="r3">
                <result type="chain">r1</result>
            </action>
            <action name="r4">
                <result type="redirectAction">/r2</result>
            </action>
        </package>    
    
    </struts>

    2、index.jsp

    <body>
    Result类型
    <ol>
    	<li><a href="r/r1">dispatcher</li>
    	<li><a href="r/r2">redirect</li>
    	<li><a href="r/r3">chain</li>
    	<li><a href="r/r4">redirectAction</li>
    	
    	<li>freemarker</li>
    	<li>httpheader</li>
    	<li>stream</li>
    	<li>velocity</li>
    	<li>xslt</li>
    	<li>plaintext</li>
    	<li>tiles</li>
    </ol>
    </body>

    3、r1.jsp

    <body>
    r1
    </body>

    4.r2.jsp

    <body>
    r2
    </body>


    5、r3.jsp

    <body>
    r3
    </body>


    6、r4.jsp
    <body>
    r4
    </body>



  • 相关阅读:
    杭电2063 过山车 匈牙利算法
    杭电2023 平均成绩
    leveldb性能分析
    linux下libreoffice安装测试
    iptables配置vsftp访问
    vsftp访问异常
    mysql二进制安装
    vi命令
    mysql配置优化
    rsync 配置
  • 原文地址:https://www.cnblogs.com/lytwajue/p/7110609.html
Copyright © 2011-2022 走看看