/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.opensymphony.xwork2.ActionSupport
 *  javax.servlet.http.HttpServletRequest
 *  javax.servlet.http.HttpServletResponse
 *  org.apache.commons.logging.Log
 *  org.apache.commons.logging.LogFactory
 *  org.apache.struts2.interceptor.ServletRequestAware
 *  org.apache.struts2.interceptor.ServletResponseAware
 *  org.apache.struts2.interceptor.SessionAware
 */
package com.hst.framework.action;

import com.opensymphony.xwork2.ActionSupport;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

public class BaseAction
extends ActionSupport
implements SessionAware,
ServletRequestAware,
ServletResponseAware {
    private static final long serialVersionUID = 1L;
    public static Log _logger = LogFactory.getLog(BaseAction.class);
    protected Map<String, Object> session;
    protected HttpServletRequest request;
    protected HttpServletResponse response;
    protected static final String RESULT_NAME_DOWNLOAD = "download";

    public void setSession(Map<String, Object> session) {
        this.session = session;
    }

    public void setServletResponse(HttpServletResponse response) {
        this.response = response;
    }

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }

    public void createMessageSucc() {
        this.createMessageByKey("system.deal.common.success");
    }

    public void createMessageExcp() {
        this.createMessageByKey("system.deal.common.exception");
    }

    public void createMessageUser(String value) {
        this.addActionMessage(value);
    }

    private void createMessageByKey(String key) {
        this.addActionMessage(this.getText(key));
    }
}
