?? baseaction.java
字號:
package com.rumtel.wep.actions;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.configuration.Configuration;
import com.opensymphony.webwork.ServletActionContext;
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionSupport;
import com.rumtel.wep.config.ApplicationConfiguration;
public abstract class BaseAction extends ActionSupport {
public static final String USERID_KEY = "userId";
public static final String PASSWORD_KEY = "password";
public static final String USERNAME_KEY = "userName";
// Session related -----------------------------------
protected void clearSession() {
getSession().remove(USERNAME_KEY);
getSession().remove(USERID_KEY);
getSession().remove(PASSWORD_KEY);
}
protected Map getApplication() {
return ActionContext.getContext().getApplication();
}
protected HttpServletRequest getRequest() {
return ServletActionContext.getRequest();
}
protected HttpServletResponse getResponse() {
return ServletActionContext.getResponse();
}
protected Map getSession() {
return ActionContext.getContext().getSession();
}
protected Configuration getConfig() {
return ApplicationConfiguration.getConfiguration();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -