// Path: teemo/src/main/java/core/support/CustomDateEditor.java
// public class CustomDateEditor extends PropertyEditorSupport {
// 
//     public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
//     public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
//     public static final DateFormat[] ACCEPT_DATE_FORMATS = { new SimpleDateFormat(DEFAULT_DATETIME_FORMAT), new SimpleDateFormat(DEFAULT_DATE_FORMAT) };
// 
//     /**
//      * Parse the Date from the given text, using the specified DateFormat.
//      */
// 
//     public void setAsText(String text) throws IllegalArgumentException {
//         if (text == null || text.trim().equals(""))
//             setValue(null);
//         for (DateFormat format : ACCEPT_DATE_FORMATS) {
//             try {
//                 setValue(format.parse(text));
//                 return;
//             } catch (ParseException e) {
//                 continue;
//             } catch (RuntimeException e) {
//                 continue;
//             }
//         }
//     }
// 
//     /**
//      * Format the Date as String, using the specified DateFormat.
//      */
// 
//     public String getAsText() {
//         return (String) getValue();
//     }
// }


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import core.support.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;

/**
 * Copyright (c) 2016- https://github.com/beiyoufx
 *
 * Licensed under the GPL-3.0
 */
package core.web.controller;



/**
 * @author yongjie.teng
 * @version 1.0
 * @date 16-10-27
 * @email yongjie.teng@foxmail.com
 * @package core.web.controller
 * @project teemo
 */
public abstract class BaseController {
    @InitBinder
    public void initBinder(WebDataBinder binder) {

// Path: teemo/src/main/java/core/support/CustomDateEditor.java
// public class CustomDateEditor extends PropertyEditorSupport {
// 
//     public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
//     public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
//     public static final DateFormat[] ACCEPT_DATE_FORMATS = { new SimpleDateFormat(DEFAULT_DATETIME_FORMAT), new SimpleDateFormat(DEFAULT_DATE_FORMAT) };
// 
//     /**
//      * Parse the Date from the given text, using the specified DateFormat.
//      */
// 
//     public void setAsText(String text) throws IllegalArgumentException {
//         if (text == null || text.trim().equals(""))
//             setValue(null);
//         for (DateFormat format : ACCEPT_DATE_FORMATS) {
//             try {
//                 setValue(format.parse(text));
//                 return;
//             } catch (ParseException e) {
//                 continue;
//             } catch (RuntimeException e) {
//                 continue;
//             }
//         }
//     }
// 
//     /**
//      * Format the Date as String, using the specified DateFormat.
//      */
// 
//     public String getAsText() {
//         return (String) getValue();
//     }
// }


// Path: teemo/src/main/java/core/web/controller/BaseController.java
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import core.support.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;

/**
 * Copyright (c) 2016- https://github.com/beiyoufx
 *
 * Licensed under the GPL-3.0
 */
package core.web.controller;



/**
 * @author yongjie.teng
 * @version 1.0
 * @date 16-10-27
 * @email yongjie.teng@foxmail.com
 * @package core.web.controller
 * @project teemo
 */
public abstract class BaseController {
    @InitBinder
    public void initBinder(WebDataBinder binder) {

        binder.registerCustomEditor(Date.class, new CustomDateEditor());
