package com.vst.webapp.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.beanutils.BeanUtils;
import com.vst.Constants;
import com.vst.model.SvodDefect;
import com.vst.service.SvodDefectManager;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class SvodDefectController implements Controller {
private final Log log = LogFactory.getLog(SvodDefectController.class);
private SvodDefectManager svodDefectManager = null;
public void setSvodDefectManager(SvodDefectManager svodDefectManager) {
this.svodDefectManager = svodDefectManager;
}
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'handleRequest' method...");
}
SvodDefect svodDefect = new SvodDefect();
// populate object with request parameters
BeanUtils.populate(svodDefect, request.getParameterMap());
List svodDefects = svodDefectManager.getSvodDefects(svodDefect);
return new ModelAndView("svodDefectList", Constants.SVODDEFECT_LIST, svodDefects);
}
}