我写了这个条件并且不起作用:
<fieldset class="rating">
<span class="course-view-rating bigger">
<label th:class="${feedback.message.rating ≥ 5}? 'active'" for="rating5"></label>
<label th:class="${feedback.message.rating ≥ 4}? 'active'" for="rating4"></label>
<label th:class="${feedback.message.rating ≥ 3}? 'active'" for="rating3"></label>
<label th:class="${feedback.message.rating ≥ 2}? 'active'" for="rating2"></label>
<label th:class="${feedback.message.rating ≥ 1}? 'active'" for="rating1" ></label>
</span>
</fieldset>
feedback.message.rating
的值始终是0到5之间的数字。
使用:
这是错误消息:
Servlet.service() for servlet [thymeleafDispatcherServlet] in context with path [/frontend-th] threw exception
[Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException:
Exception evaluating SpringEL expression: "feedback.message.rating ? 1" (template: "pages/eventdetail" - line 179, col 52)] with root cause
java.lang.IllegalStateException: Cannot handle (8805) '?'
感谢您的回复
答案 0 :(得分:0)
这是有效的,我不明白为什么:D:D
<label th:class="${feedback.message.rating >= 5}? 'active'" for="rating5"></label>
答案 1 :(得分:0)
您应该尝试这个
class NewUserTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(15)
def tearDown(self):
self.browser.quit()
...