package com.vst.webapp.action;
import com.vst.model.DefectType;
import com.vst.service.ConstructionTypeManager;
import com.vst.service.DefectTypeManager;
import org.apache.commons.lang.StringUtils;
import javax.servlet.http.HttpServletRequest;
/**
* Created by IntelliJ IDEA.
* User: ALEXEI
* Date: 08.02.2008
* Time: 0:14:09
* To change this template use File | Settings | File Templates.
*/
public class AnketaFormController extends BaseFormController {
private ConstructionTypeManager constructionTypeManager;
private DefectTypeManager defectTypeManager;
public void setDefectTypeManager(DefectTypeManager defectTypeManager) {
this.defectTypeManager = defectTypeManager;
}
public void setConstructionTypeManager(ConstructionTypeManager constructionTypeManager) {
this.constructionTypeManager = constructionTypeManager;
}
protected Object formBackingObject(HttpServletRequest request)
throws Exception {
String defectTypeId = request.getParameter("defectTypeId");
DefectType defectType = null;
if (!StringUtils.isEmpty(defectTypeId)) {
defectType = defectTypeManager.getDefectType(defectTypeId);
} else {
defectType = new DefectType();
}
return defectType;
}
}