package misclases;

import org.apache.struts2.interceptor.*;
import org.apache.struts2.util.*;
import javax.servlet.http.*;
import javax.servlet.*;

public class GrabarAction implements ServletRequestAware, ServletResponseAware{    
    String user;
    HttpServletResponse response;
    public String execute() throws Exception {
      Cookie ck=new Cookie("user",user);
	ck.setMaxAge(2000);
	response.addCookie(ck);
      return "grabado";
    }

    public String getUser(){
	return user;
    }
    public void setServletRequest(HttpServletRequest request){
	user=request.getParameter("username");
    }
    public void setServletResponse(HttpServletResponse response){
	this.response=response;
    }


    
} 
