<s:if></s:if><s:else></s:else>这个怎么用?
2 回答
已采纳
慕莱坞9220042
TA贡献377条经验 获得超508个赞
<s:if test="#session.user == null"> <div class="login"> <ul> <li id="diagx"><a href="#">On-Demand Login</a></li> <li><a href="#">Support</a></li> </ul> <a href="#" class="join-now-top"><img src="/TitanMen/images/join-now.gif" alt="Join NOW!" /></a> </div> </s:if> <s:else> <div class="login"> <ul> <li><a href="#">My Account</a></li> <li><a href="#">Support</a></li> </ul> <a href="#" class="logout-top"><img src="/TitanMen/images/btn-logout.gif" alt="Log Out!" /></a> </div> </s:else>
通过在test里判断就可以了,跟if else用法差不多,就是书写上有些区别!
添加回答
举报
0/150
提交
取消