0
私のコードがそのようでない限り:lista
がnullでない場合は、第2の条件式を評価する:
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h1 class="page-header" th:utext="#{dashboard}">Dashboard</h1>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" th:if="${lista}">
<h1 class="page-header" th:text="#{__${name}__}"></h1>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" th:if="${command}">
<h1 class="page-header"><th:block th:utext="#{__${action}__}"/> <th:block th:utext="#{__${name}__}"/></h1>
</div>
第<div>
ブロックが表示されている場合、または目。 command
がヌルでない場合、3番目の文字が表示されます。 lista
とcommand
の両方がヌルの場合、最初のものが表示されます。
${lista} && ${command}
しかし、この式ではエラーが発生します。誰もそれをする方法を知っていますか?
UPDATE
私が試してみてください。${lista && command}
と${lista and command}
が、(まだエラーをhappenning)私の問題を解決しません。
可能な重複:([目で複数の条件を持っている方のタグがthymeleaf使用している場合] http://stackoverflow.com/questions/16018577/how-タグ付き利用可能な複数の条件を有するタグを使用する) – Andrew