thymeleaf / thymeleaf-spring

Thymeleaf integration module for Spring
http://www.thymeleaf.org
Apache License 2.0
435 stars 157 forks source link

Date returning null in controller #318

Closed devesh1974 closed 10 months ago

devesh1974 commented 10 months ago

Hi,

  I am using this dependency for spring boot 3 and date is returning null in controller with request.getAttribute or getter methods
org.springframework.boot spring-boot-starter-thymeleaf

My html is

                <tr>
                <td><label for="expirydate">Expiry Date</label></td>
                <td><input type="date" th:field="*{expirydate}" required="required" placeholder="Expiry Date" class="form-control mb-4 col-4"></td>
                <td></td>
                </tr>

My pojo is this

@NotNull @DateTimeFormat(pattern="MM/dd/yyyy") @Column(name="applicationdate") private Date applicationdate ;

I am using Java 17

Please help.

Thanks in advance

Devesh