开发者

Tags usage in Struts 2

I have the following code snippet

<s:iterator status="stat" value="masterAccountList">
                <tr>
                  <td><s:property value="name"/></td>
                  <td><s:property value="status"/></td>
                 <s:set name="DrStat" id="DrStat" value="<s:property value='status'/>"/>
                  <td><s:if test='DrStat.contains("Out")'>
                      Dr. Is Available
                      </s:if>
                      <s:else>
                      Dr. Is not Available
                      </s:else>
                  </td>
                </tr>
            </s:iterator开发者_运维知识库>

I need to check the status if it contains a keyword and display text accordingly. When I try this, I always get 'Not Available' status.

I'm not even sure what the set returns, how can I see that?


Shouldn't <s:text name="DrStat" /> print the value?


The solution:

<s:if test="%{DrStat.contains('Out')}">

Work fine. Thanks Dustin.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜