HTML 属性内的 JSTL if 语句
是否可以在 JSTL 中执行类似的操作:
<div class="firstclass<c:if test='true'> someclass</c:if>">
<p>some other stuff...</p>
</div>
有没有办法让它工作,或者是否有更好的方法通过查看 JSTL-if-语句来添加类?
is it possible to do something like this in JSTL:
<div class="firstclass<c:if test='true'> someclass</c:if>">
<p>some other stuff...</p>
</div>
Is there any way to get this to work, or is there a better way to add a class by looking at a JSTL-if-statement?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
也可以直接使用 EL 表达式,如下所示:
It's also possible to use an EL expression directly like this:
对我来说,以下内容与 Java 结合使用:
For me the following worked in combination with Java:
这对我有用!
That works for me!