<bdo id='qaZS9'></bdo><ul id='qaZS9'></ul>
    1. <tfoot id='qaZS9'></tfoot>

      <legend id='qaZS9'><style id='qaZS9'><dir id='qaZS9'><q id='qaZS9'></q></dir></style></legend>

      1. <small id='qaZS9'></small><noframes id='qaZS9'>

        <i id='qaZS9'><tr id='qaZS9'><dt id='qaZS9'><q id='qaZS9'><span id='qaZS9'><b id='qaZS9'><form id='qaZS9'><ins id='qaZS9'></ins><ul id='qaZS9'></ul><sub id='qaZS9'></sub></form><legend id='qaZS9'></legend><bdo id='qaZS9'><pre id='qaZS9'><center id='qaZS9'></center></pre></bdo></b><th id='qaZS9'></th></span></q></dt></tr></i><div id='qaZS9'><tfoot id='qaZS9'></tfoot><dl id='qaZS9'><fieldset id='qaZS9'></fieldset></dl></div>
      2. Thymeleaf - 布尔运算符

        Thymeleaf - boolean operators(Thymeleaf - 布尔运算符)

        <small id='Poyeg'></small><noframes id='Poyeg'>

          <tbody id='Poyeg'></tbody>
          • <bdo id='Poyeg'></bdo><ul id='Poyeg'></ul>

              1. <legend id='Poyeg'><style id='Poyeg'><dir id='Poyeg'><q id='Poyeg'></q></dir></style></legend>
                  <tfoot id='Poyeg'></tfoot>

                  <i id='Poyeg'><tr id='Poyeg'><dt id='Poyeg'><q id='Poyeg'><span id='Poyeg'><b id='Poyeg'><form id='Poyeg'><ins id='Poyeg'></ins><ul id='Poyeg'></ul><sub id='Poyeg'></sub></form><legend id='Poyeg'></legend><bdo id='Poyeg'><pre id='Poyeg'><center id='Poyeg'></center></pre></bdo></b><th id='Poyeg'></th></span></q></dt></tr></i><div id='Poyeg'><tfoot id='Poyeg'></tfoot><dl id='Poyeg'><fieldset id='Poyeg'></fieldset></dl></div>
                • 本文介绍了Thymeleaf - 布尔运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何使用 Thymeleaf 使用布尔运算符,如 andor?

                  How can I use boolean operators like and or or using Thymeleaf?

                  例如,如果我想在只有一个条件为真的情况下显示表格中的数据.

                  For instance, if I want to show the data from a table if only one of the conditions is true.

                  <tr th:if="firstCondition or secondCondition">
                    <td th:text="${entity.attr1}"</td>
                    <td th:text="${entity.attr2}">Default Value</td>
                  </tr>
                  

                  推荐答案

                  布尔运算符就是这样工作的.您使用或"、和"而不是普通的 java 命名法.你也可以缩短你的 ifs.

                  Boolean operators work just like that. You use 'or', 'and' instead of the normal java nomenclature. You can also shorten your ifs.

                  你可以试试这个:

                  <tr th:if="${violation.remainingDebt != 0 or violation.validity}">
                  

                  您需要将它们嵌套在相同的大括号中,如果考虑到正在测试的逻辑或"运算,它们是独立的.

                  You need to nest them up in the same curly brackets, independently if they are isolated considering the logical 'or' operation being tested.

                  但要小心!如果 if 传递为 true,这只会显示 tr 及其子元素.

                  Be wary though! This will only show you the tr and it's child elements if the if passes as true.

                  这篇关于Thymeleaf - 布尔运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Embed YouTube video - Refused to display in a frame because it set #39;X-Frame-Options#39; to #39;SAMEORIGIN#39;(嵌入 YouTube 视频 - 拒绝显示在框架中,因为它将“X-Frame-Options设置为“SAMEORIGIN)
                  Stop embedded youtube iframe?(停止嵌入 youtube iframe?)
                  YouTube iframe API: how do I control an iframe player that#39;s already in the HTML?(YouTube iframe API:如何控制 HTML 中已有的 iframe 播放器?)
                  is switch(true) {... valid javascript?(是 switch(true) {... 有效的 javascript 吗?)
                  Switch/toggle div (jQuery)(切换/切换 div (jQuery))
                  How to avoid name clashes in JavaScript widgets(如何避免 JavaScript 小部件中的名称冲突)

                      <bdo id='Cd0RI'></bdo><ul id='Cd0RI'></ul>
                      <legend id='Cd0RI'><style id='Cd0RI'><dir id='Cd0RI'><q id='Cd0RI'></q></dir></style></legend>
                        <i id='Cd0RI'><tr id='Cd0RI'><dt id='Cd0RI'><q id='Cd0RI'><span id='Cd0RI'><b id='Cd0RI'><form id='Cd0RI'><ins id='Cd0RI'></ins><ul id='Cd0RI'></ul><sub id='Cd0RI'></sub></form><legend id='Cd0RI'></legend><bdo id='Cd0RI'><pre id='Cd0RI'><center id='Cd0RI'></center></pre></bdo></b><th id='Cd0RI'></th></span></q></dt></tr></i><div id='Cd0RI'><tfoot id='Cd0RI'></tfoot><dl id='Cd0RI'><fieldset id='Cd0RI'></fieldset></dl></div>
                        <tfoot id='Cd0RI'></tfoot>
                          <tbody id='Cd0RI'></tbody>
                          • <small id='Cd0RI'></small><noframes id='Cd0RI'>