Select variable expressions are used in a similar way to get property values from the selected object rather than the context. If no object is selected, the same as variable expressions are shown in the following code


<div th:object="${book}">

<p>titile: <span th:text="*{title}">The title</span>.</p>

</div>

Copy the code

*{title} selects the variable expression to get the title property value of the currently specified object book.

Message expression #{... } is used to dynamically replace and display the internationalized content of the Thymeleaf template page, using the message expression #{... } When you set up for internationalization, you also need to provide some internationalization configuration files. The use of message expressions will be explained laterCopy the code

Link expression @{… } is generally used for page skipping or resource introduction. It plays a very important role in Web development and is used very frequently. Example code is as follows:


<a  th:href="@{http://localhost:8080/order/details(orderId=${o.id})}">view</a>

<a  th:href="@{/order/details(orderId=${o.id})}">view</a>

Copy the code

In the above code, the link expression @{… } write absolute link address and relative link address respectively. In a parameterized expression, you need to follow the @{path (parameter name = parameter value, parameter name = parameter value…) }, and the value of this parameter can be passed dynamic parameter values using variable expressions

Just learned pull hook education "Java engineers high salary boot camp", see just learned point on the answer. I hope the pull check can push me to the company I want to go to, target: byte!!Copy the code