Issue
In this below code if condition is true then work well but if condition is false looking weird image src...
Here down my code
<img th:src="${(profileData.profile != null) ? profileData.profile : '../images/users/app-store.png'}" alt="" class="img-responsive profile-photo" />
Inspect
<img src(unknown) alt="" class="img-responsive profile-photo">
Output
Expected
Solution
According to https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#conditional-expressions
<img th:src="${(profileData.profile != null)} ? ${profileData.profile} : '../images/users/app-store.png'" alt="" class="img-responsive profile-photo" />
Hint: check your closing bracket }
in your initial condition
Answered By - pleft
Answer Checked By - Marie Seifert (JavaFixing Admin)