/*
* Copyright Massimiliano Dessì (desmax74@yahoo.it)
*
* Licensed for non-commercial use,
* under Apache License Version 2.0
* (http://www.apache.org/licenses/LICENSE-2.0),
*
* for commercial use, under
* GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*/
package org.magicbox.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import org.magicbox.dto.SpedizioneCriteria;
import org.magicbox.propertyEditor.DateEditor;
import org.magicbox.service.StoricoService;
import org.magicbox.util.Constant;
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.servlet.mvc.SimpleFormController;
//TODO da rifare
public class StatsController extends SimpleFormController {
public StatsController() {
setCommandClass(SpedizioneCriteria.class);
setCommandName(Constant.SPEDIZIONE);
}
public void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {
StringTrimmerEditor trimmerEditor = new StringTrimmerEditor(false);
binder.registerCustomEditor(String.class, trimmerEditor);
DateEditor dateEditor = new DateEditor(new SimpleDateFormat("dd/MM/yyyy"), true);
binder.registerCustomEditor(Date.class, dateEditor);
}
public void setStoricoService(StoricoService storicoService) {
this.storicoService = storicoService;
}
protected StoricoService storicoService;
}