hi all,

Cookie can be created in servlet . for example

public void doGet (HttpServletRequest request,  HttpServletResponse
response)
     throws ServletException, IOException
    {
        // Check for pending adds to the shopping cart
        String bookId = request.getParameter("Buy");

        //If the user wants to add a book, remember it by adding a cookie
        if (bookId != null)     { Cookie getBook = new Cookie("Buy",
bookId);  }

       // set content-type header before accessing the Writer
           response.setContentType("text/html");

       // now get the writer and write the data of the response
          PrintWriter out = response.getWriter();
         out.println("<html>" +  "<head><title> Book Catalog
</title></head>" + ...);
    }

Question

Q1...Can a two cookie be created by same name in a single servlet  ?

Q2...Can a two cookie be created by same name in a different  servlet
deployed on same web server ?

thanks





_____________________________________________________________

Visit http://www.PalmGreetings.com The first & only Mobile greeting site.
* You can send & receive e-cards using your Palm Pilot
* View animated cards on your Palm
* Draw your very own cards

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to