Hello,
I nedd to create an action that positions a cookie and refreshes the page (with all 
its parameters)
this is the code of my action and it causes a nullPointerException

public class ChangeTabAction extends Action 
{
     public static final String TabCookieName = "tabCookie";
     
    public ActionForward execute(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) throws IOException, 
ServletException
     {
          
          String tab= (String)request.getParameter("tab");
          if(tab==null||tab=="")
          {
               tab="default";
          }
          Cookie myCookie = new Cookie(TabCookieName,tab);
          response.addCookie(myCookie);
          return new ActionForward(mapping.getInput());
     }
}


I also tried return mapping.getInputForward();
but it does throw the same exception

can somebody help

Thanks
Mehdi

Reply via email to