jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: adding Cookie - request object doesn't get updated.
Date Mon, 28 Jun 2004 19:29:36 GMT
Hi Mallinath,

You must be doing something wrong... :-)

Try simplifying the problem until it works and then find out the error in
your code.

Have you tried writing and testing the following:

    public void beginCookieEncoding(WebRequest theRequest)
    {
        theRequest.addCookie("testcookie", "whatever");
    }

    public void testCookieEncoding()
    {
        javax.servlet.http.Cookie[] cookies = request.getCookies();

        assertNotNull("No cookies in request", cookies);

        for (int i = 0; i < cookies.length; i++)
        {
            if (cookies[i].getName().equals("testcookie"))
            {
                assertEquals("whatever", cookies[i].getValue());
                return;
            }
        }

        fail("No cookie named 'testcookie' found");
    }

-Vincent

> -----Original Message-----
> From: Mallinath Suralikal (C) [mailto:Mallinath.Suralikal@neoforma.com]
> Sent: jeudi 10 juin 2004 21:50
> To: Cactus Users List
> Subject: adding Cookie - request object doesn't get updated.
> 
> Hi,
> 
> I am adding the Cookies using WebRequest.addCookie(String, String).  At
> the
> server side, if I do getCookies(), it's returning null. Looks like the
> cookies are not updated on the request.
> 
> Thanks
> Malli
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004
> 


Mime
View raw message