나 최대 절전 모드 엔티티와 빈을 가지고 또한스프링 MVC 날짜 형식 : 입력
@Entity
public class GeneralObservation {
@DateTimeFormat(pattern = "dd/MM/yyyy")
Date date;
@Column
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}
나는 내 URL로 이동하면
@InitBinder
protected void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
binder.registerCustomEditor(Date.class, new CustomDateEditor(
dateFormat, false));
}
및
form:input
id = "datepicker"
name="date"
itemLabel="date"
path="newObservation.date"
이 알겠습니다 :
어떻게 mm/DD/yyyy 형식으로 만들 수 있습니까?
'@DateTimeFormat (패턴 = "일/DD/yyyy'로 변경하려고 했습니까? 'mm/DD/yyyy'로 변경하려고 했습니까? –
http : //stackoverflow.com/questions/3457134/how-to-display-a-formatted-datetime-in-spring-mvc-3-0 – Algorithmist
아니요, 이것은 도움이되지 않습니다 : form : input은 기본값은 명시 적으로 –