Package com.vst.webapp.action

Source Code of com.vst.webapp.action.AnketaFormController

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;
    }
}
TOP

Related Classes of com.vst.webapp.action.AnketaFormController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.