java – Duration.getSeconds() is forbbiden in thymleaf expression

<input autocomplete=”off” class=”layui-input” name=”accessTokenTimeToLive” placeholder=”access token time to live” type=”number” th:value=”${oauth2Client.tokenSettings.accessTokenTimeToLive.getSeconds()}”> org.springframework.expression.EvaluationException: Calling methods is forbidden for type ‘java.time.Duration’ in Thymeleaf expressions. Blacklisted packages are: [jakarta.*, java.*, javax.*, org.ietf.jgss.*, org.omg.*, org.w3c.dom.*, org.xml.sax.*]. Whitelisted classes are: [java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.Double, java.lang.Enum, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Math, java.lang.Number, java.lang.Short, java.lang.String, java.math.BigDecimal, java.math.BigInteger, java.math.RoundingMode, java.time.*, java.util.ArrayList, java.util.Calendar, java.util.Collection, java.util.Date, … Read more