⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formbean.java

📁 A Java web application, based on Struts and Hibernate, that serves as an online running log. Users m
💻 JAVA
字号:
/* @LICENSE_COPYRIGHT@ */package net.sf.irunninglog.servlet.formbean;import javax.servlet.http.HttpServletRequest;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionMapping;import net.sf.irunninglog.servlet.UserContainer;/** * Extension of the Struts <code>ActionForm</code> class used to represent any * data that needs to be displayed in the application's view tier.  This class * currently provided an override of the <code>reset</code> method which allows * convenient access to the user's <code>UserContainer</code> instance. * * @author <a href="mailto:allan_e_lewis@yahoo.com">Allan Lewis</a> * @version $Revision: 1.1.1.1 $ $Date: 2005/06/23 01:49:00 $ * @since iRunningLog 1.0 */public abstract class FormBean extends ActionForm {    /** <code>Log</code> instance for this class. */    private static final Log LOG = LogFactory.getLog(FormBean.class);    /**     * Create a new form bean.     */    public FormBean() {        super();    }    /**     * Reset the state of a form bean.  This is a method invoked by the Struts     * framework during request processing.  This method is final and delegates     * all work to the 3-argument <code>reset</code> method.     *     * @param mapping The mapping used to select this instance     * @param request The servlet request we are processing     * @see #reset(ActionMapping, HttpServletRequest, UserContainer)     */    public final void reset(ActionMapping mapping,                            HttpServletRequest request) {        super.reset(mapping, request);        if (LOG.isDebugEnabled()) {            LOG.debug("reset: State before resetting " + this);        }        reset(mapping, request, UserContainer.getUserContainer(request));        if (LOG.isDebugEnabled()) {            LOG.debug("reset: State after resetting " + this);        }    }    /**     * Reset the state of a form bean.  This method can be overridden by     * subclasses to perform any necessary logic.  This     * method is invoked from the 3-argument <code>reset</code> method, which     * is called from the Struts framework during request processing.     *     * @param mapping The mapping used to select this instance     * @param request The servlet request we are processing     * @param container The current user's container object     * @see #reset(ActionMapping, HttpServletRequest)     */    protected void reset(ActionMapping mapping, HttpServletRequest request,                         UserContainer container) {        if (LOG.isDebugEnabled()) {            LOG.debug("reset: Resetting using the following request "                      + request);            LOG.debug("reset: Resetting using the following user container "                      + container);        }    }}

⌨️ 快捷键说明

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