「Java」org.apache.struts2.interceptor.SessionAwareを実装するサンプルコード
Javaコード:
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
public class SessionDemoAction extends ActionSupport implements SessionAware {
private Map session;
public void setSession(Map session) {
this.session = session;
}
public String execute() {
this.session.put(“USER_NAME", “yamada_user");
return SUCCESS;
}
}