use of org.springframework.web.bind.annotation.InitBinder in project uPortal by Jasig.
the class BaseStatisticsReportController method initBinder.
@InitBinder
public void initBinder(WebDataBinder binder) {
final DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendPattern("M/d/yyyy").toFormatter();
binder.registerCustomEditor(DateMidnight.class, new CustomDateMidnightEditor(formatter, false));
}
use of org.springframework.web.bind.annotation.InitBinder in project SpringStepByStep by JavaProgrammerLB.
the class TodoController method initBinder.
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat(TodoListUtils.DATE_FORMAT);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
binder.registerCustomEditor(Priority.class, new TodoPriorityPropertyEditor());
}
use of org.springframework.web.bind.annotation.InitBinder in project Asqatasun by Asqatasun.
the class AbstractUserAndContractsController method initBinder.
@InitBinder
protected void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
use of org.springframework.web.bind.annotation.InitBinder in project webapp by elimu-ai.
the class ApplicationVersionCreateController method initBinder.
/**
* See http://www.mkyong.com/spring-mvc/spring-mvc-failed-to-convert-property-value-in-file-upload-form/
* <p></p>
* Fixes this error message:
* "Cannot convert value of type [org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile] to required type [byte] for property 'bytes[0]'"
*/
@InitBinder
protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws ServletException {
logger.info("initBinder");
binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
}
use of org.springframework.web.bind.annotation.InitBinder in project webapp by elimu-ai.
the class AudioCreateController method initBinder.
/**
* See http://www.mkyong.com/spring-mvc/spring-mvc-failed-to-convert-property-value-in-file-upload-form/
* <p></p>
* Fixes this error message:
* "Cannot convert value of type [org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile] to required type [byte] for property 'bytes[0]'"
*/
@InitBinder
protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws ServletException {
logger.info("initBinder");
binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
}
Aggregations