Have you specified an input attribute in your action mapping in
struts-config.xml?

-----Original Message-----
From: Mehdi EL AKARI [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 17 September 2003 16:18
To: struts
Subject: How to refresh a page in an action


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to