Struts2入門–RequestAwareとSessionAwareを使ってRequestオブジェクトを取得する

Javaコード:
import java.util.Map;

import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class Logincft2Action extends ActionSupport
implements RequestAware , SessionAware, ApplicationAware{
private Map request;
private Map session;
private Map application;

@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
this.request.put(“attribute", “request value servlet not IoC “);
this.session.put(“attribute", “session value servlet not IoC “);
this.application.put(“attribute", “application value servlet not IoC “);
return SUCCESS;
}

@Override
public void setRequest(Map<String, Object> arg0) {
// TODO Auto-generated method stub
this.request = arg0;
}

@Override
public void setSession(Map<String, Object> arg0) {
// TODO Auto-generated method stub
this.session = arg0;
}

@Override
public void setApplication(Map<String, Object> arg0) {
// TODO Auto-generated method stub
this.application = arg0;
}
}

Java

Posted by arkgame