- Java code
<s:if test="%{keyPeopleFlag.isBaby} == 0"> <div id="keyPeopleflag.FlagBaby" class="divFlag" style="background-color:RGB(204, 255, 204); color : black;"> 儿童s:if </div></s:if><s:else> <div id="keyPeopleflag.FlagBaby" class="divFlag" style="background-color:RGB(255, 255, 255); color : gray;"> 儿童s:else </div></s:else>
以上是页面代码
- Java code
private TKeyPeopleFlag keyPeopleFlag; public TKeyPeopleFlag getKeyPeopleFlag() { return keyPeopleFlag; } public void setKeyPeopleFlag(TKeyPeopleFlag keyPeopleFlag) { this.keyPeopleFlag = keyPeopleFlag; }
以上是 ACTION中的代码
已经在 action中放了 SET 和GET 方法,但是在 s:if 标签中怎么比较才能得出正确的值????
已经试验了,好几次,都无法得到正确的结果
有高手来回答一下吧
------解决方案--------------------------------------------------------
lz把这<s:if test="%{keyPeopleFlag.isBaby} == 0">
改成这样
<s:if test="%{keyPeopleFlag.isBaby == 0}">
------解决方案--------------------------------------------------------
如果还不行的话 再<s:if test="${keyPeopleFlag.isBaby} == '0'">
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
<s:if test="%{keyPeopleFlag.isBaby == 0 }">
或
<s:if test="%{keyPeopleFlag.isBaby == \"0\" }">
------解决方案--------------------------------------------------------
<s:if test="${keyPeopleFlag.isBaby == '0'}">