• struts2 if test使用


    1

    <table class="table">
        <tr>
            <th>获取条件</th>
            <th>操作</th>
        </tr>
        <s:iterator value="coupons" id="coupon" status="st">
            <tr>
                <td><s:if test="%{value==-1}">
                        到店领取
                    </s:if> <s:elseif test="%{value==0}">
                        免费领取
                    </s:elseif>
                    <s:else>
                        <s:property value="value" /> 积分</s:else></td>
                <td ><s:date name="startdate"  format="yyyy年MM月dd日"/> --<s:date name="expiredate"  format="yyyy年MM月dd日"/></td>
               
                <td>
                    <s:if test="%{deleted==false}">
                        <a href="removeCoupon_manage?coupon.id=<s:property value="id" />"
                            onclick="return confirm ('确定下架?')">下架</a>
                    </s:if> <s:else>
                        <a href="deployCoupon_manage?coupon.id=<s:property value="id" />"
                            onclick="return confirm ('确定上架?')">上架</a>
                    </s:else>
       
                    <s:if test="%{ad==null}">
                        <a href="deploy_ad?ad.id=<s:property value="id" />"
                            onclick="return confirm ('设为广告页')">设为广告页</a>
                    </s:if> <s:else>
                        <a href="delete_ad?ad.id=<s:property value="id" />"
                            onclick="return confirm ('删除广告页')">取消广告页</a>
                    </s:else></td>
            </tr>
        </s:iterator>
    
    </table>

     2、判断条件使用“或”:||

    <s:if test="%{#session.admin!=null||#session.operator!=null}">
    </s:if>

      3、判断条件使用“并且”:&&

    Done

  • 相关阅读:
    mysql check约束无效
    Illegal mix of collations for operation 'concat'
    执行automake时报错 error while making link: Operation not supported
    GCC 编译详解[转]
    gcc的选项
    关于MFLAGS与MAKEFLAGS
    gcc和g++的区别
    g++参数介绍
    gcc/g++基本命令简介
    semver语义化版本号
  • 原文地址:https://www.cnblogs.com/xingyyy/p/3918351.html
Copyright © 2020-2023  润新知