Linked Questions
10 questions linked to/from Using Thymeleaf when the value is null
7 votes
2 answers
37k views
EL1007E: Property or field 'fieldName' cannot be found on null
Good evenning i no longer have a solution ..Ive been hesitating to ask for help but Im litteraly at a dead end . Im working on a Spring boot 2.0.5 Spring MVC 5.0.9, ThymeLeaf 3.0.9 project that needs ...
1 vote
2 answers
2k views
Thymeleaf nested object iteration
I am trying to iterate over a list that contains another list. @Entity @Table(name = "session") public class TrainingSession implements Serializable { @Id @GeneratedValue(strategy = GenerationType....
2 votes
1 answer
2k views
Accessibility : empty alt attribute in thymeleaf
It is a good practice to use an empty alt attribute for images that don't need or don't have a text description. This is done by setting an empty alt attribute : <img alt=""... However in ...
0 votes
3 answers
2k views
org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'items' cannot be found on null
How to solve this error? I'm using thymeleaf together with spring and there's an error when parsing the following html segment. org.springframework.expression.spel.SpelEvaluationException: EL1007E: ...
0 votes
1 answer
617 views
How can I hide <span> when it is empty
I am working on a user login form. It is on my "home.html" , I want to show the username after login(when I get session datas form "login.html" by "Httpsession") Otherwise just hide when it is ...
0 votes
1 answer
295 views
How to add an element to a list with condition using th:with?
I'm trying to create a list of elements, but the elements may be added if they satisfy their given conditions, for example : <\div th:with = "$list = { {[condition1] ? [value1 if true] : null, [...
0 votes
1 answer
151 views
Render a list in thymleaf
I have three Entities User, Albums and Photo, In User l have a collection of Album, in Album l have a collection of photos. Now in my user.htlm i would like to know foreach user the number of album ...
0 votes
0 answers
182 views
How do check the object existence in thymleaf html using springboot java? Property or field 'numBrothers' cannot be found on null in thymleaf
Refer the payloads 1 and 2 below, "fy" fields are absent in the payload1. I tried with if else conditions, but no luck, still I am getting error. Is there a way to check object present or ...
0 votes
1 answer
102 views
Thymeleaf how to use model atrribute correctly its throwing null error
public class Customer { @Id @GeneratedValue private Integer id; private String email; private Long Apprvamount; @JsonIgnore @OneToMany(mappedBy="customer", fetch = FetchType.LAZY, cascade ...
0 votes
0 answers
99 views
Thymeleaf - Is there a way to get a null value in the controller instead of a blank String for a blank field?
I have a thymeleaf form and I would like to return a NULL value to my underlying controller instead of a blank String. Is there a way to do this directly in thymeleaf or do we have to set that ...