abstractpetfc.java

来自「sping下勇Xdoclet开发hibernate的程序实例,版本hiberna」· Java 代码 · 共 35 行

JAVA
35
字号
package org.ggyy.web.ctrl;

import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.ggyy.dao.ICatDao;
import org.ggyy.service.exception.DuplicationFormSubmitException;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.validation.BindException;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

abstract public class AbstractPetFC extends SimpleFormController {
    private ICatDao catDao;

    protected ModelAndView disallowDuplicateFormSubmission(
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        BindException errors = new BindException(formBackingObject(request),
                getCommandName());
        errors.reject("duplicateFormSubmission", null,
                "Duplicate form submission");
        throw new DuplicationFormSubmitException("duplicate form submission");
    }

    public ICatDao getCatDao() {
        return catDao;
    }

    public void setCatDao(ICatDao catDao) {
        this.catDao = catDao;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?