public class Person{ private String name,lastname; private int age; public Person(String name,String lastname,int age) { this.name = name; this.lastname=lastname; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
<div th:object="${person}"> <p th:text="*{name}">Name</p> <p th:text="*{lastname}">LastName</p> <p th:text="*{age}">Age</p> </div>
<div> <p>dogukan</p> <p>han</p> <p>21</p> </div>