Java Thymeleaf:张贴或放入<;表格>;th:取决于条件的操作
根据Java Thymeleaf:张贴或放入<;表格>;th:取决于条件的操作,java,thymeleaf,Java,Thymeleaf,根据th:if,是否可以在from th:action中指定POST或PUT方法 比如: Thymeleaf具有条件运算符 condition ? first_expression : second_expression; 您可以将此运算符用于以下目的: <form th:action="@{~/firms/save}" th:method="${firm.firmId} != null ? PUT : POST" modelAttribute="firm" th:object="$
th:if
,是否可以在from th:action
中指定POST
或PUT
方法
比如:
Thymeleaf具有条件运算符
condition ? first_expression : second_expression;
您可以将此运算符用于以下目的:
<form th:action="@{~/firms/save}" th:method="${firm.firmId} != null ? PUT : POST" modelAttribute="firm" th:object="${firm}">
Thymeleaf具有条件运算符
condition ? first_expression : second_expression;
您可以将此运算符用于以下目的:
<form th:action="@{~/firms/save}" th:method="${firm.firmId} != null ? PUT : POST" modelAttribute="firm" th:object="${firm}">