2016-02-22 2 views
0

У меня странное поведение. У меня есть форма, которая представляет 2 поля даты в немецком dateformat (dd.mm.yyyy). Поля сущности из типа LocalDate. Все работает так, как ожидалось, но не в феврале. Если пользователь вводит день месяца больше 28 (30.march, 29.april, 29.may ..), приложение Spring mvc выдает исключение BindException.30.03.2016 throws BindException с LocalDate

org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 2 errors 
Field error in object 'activity' on field 'beginsOnDate': rejected value [31.03.2016]; codes [methodInvocation.activity.beginsOnDate,methodInvocation.beginsOnDate,methodInvocation.java.time.LocalDate,methodInvocation]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [activity.beginsOnDate,beginsOnDate]; arguments []; default message [beginsOnDate]]; default message [Property 'beginsOnDate' threw exception; nested exception is java.time.DateTimeException: Invalid date 'FEBRUARY 31'] 
Field error in object 'activity' on field 'endsOnDate': rejected value [31.03.2016]; codes [methodInvocation.activity.endsOnDate,methodInvocation.endsOnDate,methodInvocation.java.time.LocalDate,methodInvocation]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [activity.endsOnDate,endsOnDate]; arguments []; default message [endsOnDate]]; default message [Property 'endsOnDate' threw exception; nested exception is java.time.DateTimeException: Invalid date 'FEBRUARY 31'] 
at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:113) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:78) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:871) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845) [spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at com.github.dandelion.core.web.DandelionFilter.doFilter(DandelionFilter.java:138) [dandelion-core-0.10.1.jar:na] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:178) [spring-orm-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.tuckey.web.filters.urlrewrite.gzip.GzipFilter.doFilter(GzipFilter.java:85) [urlrewritefilter-4.0.4.jar:4.0.4] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:157) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:133) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:120) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) [spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] 
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) [tomcat-embed-core-7.0.47.jar:7.0.47] 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60] 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60] 
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60] 

Я понятия не имею, что не так.

Исключение составляет весна 4.1 и 4.2.

Если я введу дату ниже 28 месяцев, т. Е. 13.05.2016. все работает нормально.

рассматривает Рицци

Update # 1 - контроллер кода из демо-Спринг загрузки приложений для воспроизведения

@org.springframework.stereotype.Controller 
@RequestMapping("/") 
@SessionAttributes(types = {Activity.class}) 
public class Controller { 

    @RequestMapping(method = RequestMethod.GET) 
    public String get(Model model) { 
     Activity activity = new Activity(); 
     activity.setBeginsOn(LocalDateTime.now()); 
     activity.setEndsOn(LocalDateTime.now().plusMinutes(15)); 
     model.addAttribute(activity); 
     return "demo"; 
    } 

    @RequestMapping(method = RequestMethod.POST) 
    public String post(@ModelAttribute Activity activity) { 
     System.out.println(activity.getBeginsOnDate()); 
     System.out.println(activity.getEndsOnDate()); 
     return "demo"; 
    } 
} 

Entity Код:

public class Activity { 

private LocalDateTime beginsOn, endsOn; 

@DateTimeFormat(style = "M-") 
private LocalDate beginsOnDate, endsOnDate; 
@DateTimeFormat(style = "-S") 
private LocalTime beginsOnTime, endsOnTime; 

public LocalDateTime getBeginsOn() { 
    return beginsOn; 
} 

public void setBeginsOn(LocalDateTime beginsOn) { 
    this.beginsOn = beginsOn; 
    if (beginsOn != null) { 
     this.beginsOnDate = beginsOn.toLocalDate(); 
     this.beginsOnTime = beginsOn.toLocalTime(); 
    } 
} 

public LocalTime getBeginsOnTime() { 
    return beginsOnTime; 
} 

public void setBeginsOnTime(LocalTime beginsOnTime) { 
    this.beginsOnTime = beginsOnTime; 
    if (beginsOnTime != null) { 
     beginsOn.with(ChronoField.HOUR_OF_DAY, beginsOnTime.get(ChronoField.HOUR_OF_DAY)); 
     beginsOn.with(ChronoField.MINUTE_OF_HOUR, beginsOnTime.get(ChronoField.MINUTE_OF_HOUR)); 
    } 
} 

public LocalDateTime getEndsOn() { 
    return endsOn; 
} 

public void setEndsOn(LocalDateTime endsOn) { 
    this.endsOn = endsOn; 
    if (endsOn != null) { 
     this.endsOnDate = endsOn.toLocalDate(); 
     this.endsOnTime = endsOn.toLocalTime(); 
    } 
} 

public LocalTime getEndsOnTime() { 
    return endsOnTime; 
} 

public void setEndsOnTime(LocalTime endsOnTime) { 
    this.endsOnTime = endsOnTime; 
    if (endsOnTime != null) { 
     endsOn.with(ChronoField.HOUR_OF_DAY, endsOnTime.get(ChronoField.HOUR_OF_DAY)); 
     endsOn.with(ChronoField.MINUTE_OF_HOUR, endsOnTime.get(ChronoField.MINUTE_OF_HOUR)); 
    } 
} 

public LocalDate getBeginsOnDate() { 

    return beginsOnDate; 
} 

public void setBeginsOnDate(LocalDate beginsOnDate) { 
    this.beginsOnDate = beginsOnDate; 
    if (beginsOnDate != null) { 
     if (beginsOn == null) 
      beginsOn = LocalDateTime.of(beginsOnDate.get(ChronoField.YEAR), beginsOnDate.get(ChronoField.MONTH_OF_YEAR), beginsOnDate.get(ChronoField.DAY_OF_MONTH), 0, 0); 
     else { 
      beginsOn.with(ChronoField.DAY_OF_MONTH, beginsOnDate.get(ChronoField.DAY_OF_MONTH)); 
      beginsOn.with(ChronoField.MONTH_OF_YEAR, beginsOnDate.get(ChronoField.MONTH_OF_YEAR)); 
      beginsOn.with(ChronoField.YEAR, beginsOnDate.get(ChronoField.YEAR)); 
     } 
    } 
} 

public LocalDate getEndsOnDate() { 
    return endsOnDate; 
} 

public void setEndsOnDate(LocalDate endsOnDate) { 
    this.endsOnDate = endsOnDate; 
    if (endsOnDate != null) { 
     if (endsOn == null) 
      endsOn = LocalDateTime.of(endsOnDate.get(ChronoField.YEAR), endsOnDate.get(ChronoField.MONTH_OF_YEAR), endsOnDate.get(ChronoField.DAY_OF_MONTH), 0, 0); 
     else { 
      endsOn.with(ChronoField.DAY_OF_MONTH, endsOnDate.get(ChronoField.DAY_OF_MONTH)); 
      endsOn.with(ChronoField.MONTH_OF_YEAR, endsOnDate.get(ChronoField.MONTH_OF_YEAR)); 
      endsOn.with(ChronoField.YEAR, endsOnDate.get(ChronoField.YEAR)); 
     } 
    } 
} 

} 

activityForm.html

<!doctype html> 
<html xmlns:th="http://www.thymeleaf.org"> 
<head> 
    <title>BindException Demo</title> 
</head> 
<body> 
<b>BindException Demo Page</b> 
<form id="activityForm" th:action="@{/}" th:object="${activity}" action="#" method="post" th:method="post"> 
    <label>BeginsOnDate:</label> 
    <input type="text" 
      th:field="*{beginsOnDate}" 
      th:class="${#fields.hasErrors('beginsOnDate')} ? 'field-error'" /> 
    <br /> 
    <label>EndsOnDate:</label> 
    <input type="text" 
      th:field="*{endsOnDate}" 
      th:class="${#fields.hasErrors('endsOnDate')} ? 'field-error'" /> 
    <br /> 
    <input th:type="submit" /> 
</form> 
</body> 
</html> 
+0

Звучит как ошибка, которую вы должны сообщить весне. – Andreas

+0

@RizziCR вы можете опубликовать код своего контроллера? –

+0

Добавить код из демонстрационной заявки – RizziCR

ответ

0

Я понимаю, что это не ошибка. После того, как я когда-нибудь играл с демо-приложением, я нашел настоящую проблему. Проблема была между дисплеем и стулом. Я не понимаю, что мне нужно переназначить переменную времени даты при работе с методом «с» переменной даты.

Смежные вопросы