I would like to save the properties defined by users on the client side. In
order to do that, I try to use cookies but it doesn't work :
I've configured IE5 so that it warns me when it receives a cookie but I
receive warnings randomly (so I suppose that my JSP page sends cookies
randomly)
In addition to that when I receive a cookie the expiration date is set to
the year 2015 or more

Does anybody know what do I do wrong ?

I use JRun build 157 and the part of my JSP page where I send the cookie is
:

<table>
      <form>
        <tr>
          <td> Nombre de messages par page : </td>
          <td> <input type="text" name="numberOfElementsPerPage"> </td>
          <td> <input type="submit" value="Validez"> </td>
        </tr>
      </form>
    </table>

    <%
      if(request != null)
      {
        Cookie cookie;

        if(request.getParameter("numberOfElementsPerPage") != null
        && Integer.parseInt(request.getParameter("numberOfElementsPerPage"))
> 0)
        {

          cookie = new Cookie
          (
            "idea",
            request.getParameter("numberOfElementsPerPage")
          );

          cookie.setMaxAge(60*60*24*30);
          response.addCookie(cookie);


view.setNumberOfElementsPerPage(Integer.parseInt(request.getParameter("numbe
rOfElementsPerPage")));
        }
      }
    %>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to