`

struts2中if标签中字符串比较的正确写法

阅读更多
错误写法:
<s:if test="aStringProperty == 'A'">

  Why doesn't this work when myString is equal to A?

</s:if>


正确写法:
<s:if test='aStringProperty == "A"'>

  This works!

</s:if>

<s:if test="aStringProperty == \"A\"">

  This works too!

</s:if>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics