package subscription;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;
public class SubscribeAction extends Action
{
    public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest servletRequest,
                                 HttpServletResponse servletResponse)
 {
       SubscribeActionForm subscribeActionForm = (SubscribeActionForm)
                                                  actionForm;
       int age = subscribeActionForm.getAge();
        if (age >= 18)
{
            return actionMapping.findForward("register");
         }
        return null;
    }
}
