我想知道哪边出现问题?或者怎么解决?

有点纠结,在迭代里进行比较,如果条件成立,显示文字,不成立则显示按钮

两个比较的值都是为Long型的

<s:iterator value="payTerraceList">  

    <tr>  

        <td><s:property value="payTerraceName"/></td>  

        <td>  

            <s:if test="payTerraceId==payStyle2.payTerrace.payTerraceId">  

                <a style="color: red;">当前绑定接口 &nbsp;&nbsp;&nbsp;&nbsp;${payStyle2.payTerrace.payTerraceId}==${payTerraceId}</a>  

            </s:if>  

            <s:else>  

                <input type="button" value="绑定此接口" class="smallbtn" id="upChoos2" onclick="binDingPayTerrace('${payTerraceId}','${payStyle2.payStyleId}')">  

            </s:else>  

        </td>  

    </tr>  

</s:iterator>  

 页面显示结果如下面附件所示

<s:if test="payTerraceId==payStyle2.payTerrace.payTerraceId">
我尝试过

<s:if test="%{payTerraceId==payStyle2.payTerrace.payTerraceId}">

但是貌似结果一样 

直接替换成<s:if test='"13076052772170005"=="13076052772170003"'>

就不成立了......


湖上湖
浏览 96回答 2
2回答

慕雪6442864

用<s:if test="#{payTerraceId==payStyle2.payTerrace.payTerraceId}">、<s:if test="payTerraceId eq payStyle2.payTerrace.payTerraceId"> 和<s:if test="%{payTerraceId eq payStyle2.payTerrace.payTerraceId}">试试,好久没用了,记不太清了。希望有帮助

哔哔one

<s:if test='13076052772170005==13076052772170003'>试试
打开App,查看更多内容
随时随地看视频慕课网APP