![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
struts2标签<s:if>问题
html中代码:<s:iftest="discount=='1'">无</s:if><s:iftest="discount=='0.95'">9.5折</s:if><s:...
html中代码:
<s:if test="discount=='1'">无</s:if>
<s:if test="discount=='0.95'">9.5折</s:if>
<s:if test="discount=='0.9'">9折</s:if>
<s:if test="discount=='0.85'">8.5折</s:if>
<s:if test="discount=='0.8'">8折</s:if>
从后台取到discount为1,却不显示“无”。而其它四种情况都可以显示。怎么回事? 展开
<s:if test="discount=='1'">无</s:if>
<s:if test="discount=='0.95'">9.5折</s:if>
<s:if test="discount=='0.9'">9折</s:if>
<s:if test="discount=='0.85'">8.5折</s:if>
<s:if test="discount=='0.8'">8折</s:if>
从后台取到discount为1,却不显示“无”。而其它四种情况都可以显示。怎么回事? 展开
2个回答
展开全部
首先需要确定返回的就是 1,你可以在页面上打印一下discount,看看具体的形式是什么样的[discount],看看前后是不是有空格什么的···
追问
打印了一下,是1,前面、后面都没有空格。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询