The shortest way is using ‘?’ operator. If you have User entity with embedded Address entity in order to access fields of Address entity and print them if address is not null, otherwise here will be an empty column:
<td th:text="${user?.address?.city}"></td>
More Related Contents:
- Thymeleaf – How to add checked attribute to input conditionally
- How to set thymeleaf th:field value from other variable
- Inserting an image from local directory in thymeleaf spring framework (with maven)
- Chart data exported to an Apps Script webapp is null
- Is it valid to replace http:// with // in a ?
- Compiling dynamic HTML strings from database
- File input ‘accept’ attribute – is it useful?
- Responsively change div size keeping aspect ratio [duplicate]
- How to prevent downloading images and video files from my website?
- Rendering problems using flexbox in Firefox and Chrome 48 [duplicate]
- How do I prevent site scraping? [closed]
- How to properly reference local resources in HTML?
- How to wrap text of HTML button with fixed width?
- Image width/height as an attribute or in CSS? [duplicate]
- What’s default HTML/CSS link color?
- How to force a Download File prompt instead of displaying it in-browser with HTML?
- Why is a self-closing iframe tag preventing further DOM elements to be displayed?
- CSS: stretching background image to 100% width and height of screen?
- Starting with a forward slash in html for “href”
- How to Animate Gradients using CSS
- Chart.js canvas resize
- iOS 11 Safari bootstrap modal text area outside of cursor
- How to properly use h1 in HTML5
- Stop LastPass filling out a form
- How to change cursor color without changing text color?
- Prefilling gmail compose screen with HTML text
- How do I use an image as a submit button?
- How to create tables from column data instead of row data in HTML?
- Media queries not working inside an iframe
- How do I style radio buttons with images – laughing smiley for good, sad smiley for bad?