Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring Thymeleaf下拉列表已禁用并显示_Java_Spring_Thymeleaf - Fatal编程技术网

Java Spring Thymeleaf下拉列表已禁用并显示

Java Spring Thymeleaf下拉列表已禁用并显示,java,spring,thymeleaf,Java,Spring,Thymeleaf,我有: 没有一个 对 如果没有userProfile权限,我想禁用此选择 问题是:如果我有disabled属性,下拉列表不会出现。 如果删除了禁用属性,则会出现下拉列表 我可以禁用该功能并同时显示下拉列表吗 谢谢。th:除非使整个标签消失。相反,使用th:disabled并使用Thymeleaf设置条件 <select th:unless="${#strings.contains(session.userProfile.permission, 'UPDATE_GENERAL')}" d

我有:


没有一个
对
如果没有userProfile权限,我想禁用此选择

问题是:如果我有disabled属性,下拉列表不会出现。 如果删除了禁用属性,则会出现下拉列表

我可以禁用该功能并同时显示下拉列表吗


谢谢。

th:除非
使整个标签消失。相反,使用
th:disabled
并使用Thymeleaf设置条件

<select th:unless="${#strings.contains(session.userProfile.permission, 'UPDATE_GENERAL')}" disabled="disabled" id="kt_select2_10" name="sbSmtpSecurity">
<option th:value="false">None</option>
<option th:value="true" th:selected="${systemSetting.sbSmtpSecurity}">Yes</option>
</select>

没有一个
对

th:除非
使整个标记消失。相反,使用
th:disabled
并使用Thymeleaf设置条件

<select th:unless="${#strings.contains(session.userProfile.permission, 'UPDATE_GENERAL')}" disabled="disabled" id="kt_select2_10" name="sbSmtpSecurity">
<option th:value="false">None</option>
<option th:value="true" th:selected="${systemSetting.sbSmtpSecurity}">Yes</option>
</select>

没有一个
对