package sample.ac;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class RequestJspAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
// Stringデータをセッションに格納
request.setAttribute("stringData","てすとでーた");
// ユーザーデータをセッションに格納
UserData data = new UserData();
data.setUserId("usr01");
data.setUserName("name");
request.setAttribute("userData",data);
return mapping.findForward("success");
} }
|