BeanAction

来源:互联网 发布:旅行者一号 知乎 编辑:程序博客网 时间:2024/05/29 13:59
public abstract class AbstractBean extends BaseBean implements Serializable {
    
/**
     * Method validate
     * 
     * 
@param mapping
     * 
@param request
     * 
@return ActionErrors
     
*/

    
public ActionErrors validate(ActionMapping mapping,
            HttpServletRequest request) 
{
        
return null;
    }


    
private ActionContext getActionContext() {
        
return ActionContext.getActionContext();
    }


    
protected HttpServletRequest getRequest() {
        
return getActionContext().getRequest();
    }


    
protected HttpServletResponse getResponse() {
        
return getActionContext().getResponse();
    }


    
protected HttpSession getSession() {
        
return getRequest().getSession();
    }


    
protected ServletContext getServletContext() {
        
return getServletConfig().getServletContext();
    }


    
protected ServletConfig getServletConfig() {
        
return servlet.getServletConfig();
    }

}