I'm trying to use th:pattern
for date input form field like following for a thymeleaf template using spring-mvc but without luck. Anybody else experienced similar thing and has some insight or alternative?
I tried 1. hard-coding the pattern
<input type="text" th:pattern="MM/dd/yyyy" th:field="*{classDate}"/>
received Error:
Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "MM/dd/yyyy"
And 2. setting pattern in java code for template to use
<input type="date" th:pattern="${classdate_format}" th:field="*{classDate}"/>
received Error:
Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.thymeleaf.spring3.processor.attr.SpringInputGeneralFieldAttrProcessor'