Package org.apache.cactus

Examples of org.apache.cactus.Cookie


                int equalsChar = nameValue.indexOf("=");
                String name = nameValue.substring(0, equalsChar);
                String value = nameValue.substring(equalsChar + 1);
                if (name.equalsIgnoreCase(theTarget))
                {
                    return new Cookie(theConnection.getURL().getHost(),
                        name, value);
                }
            }
            key = theConnection.getHeaderFieldKey(++i);
        }
View Full Code Here


     */
    public void testCreateHttpStateWhenSeveralCactusCookieExist()
        throws Exception
    {
        WebRequest request = new WebRequestImpl();
        request.addCookie(new Cookie("domain1", "name1", "value1"));
        request.addCookie(new Cookie("domain2", "name2", "value2"));
       
        HttpState state = new HttpState();
        state.addCookies(CookieUtil.createHttpClientCookies(request,
            new URL("http://jakarta.apache.org")));

View Full Code Here

            throw new ChainedRuntimeException("Failed to connect to ["
                + ((WebConfiguration) getConfiguration()).getRedirectorURL(this)
                + "]", e);
        }

        Cookie cookie = response.getCookieIgnoreCase("jsessionid");

        // TODO: Add a constructor to the Cookie class that takes a Cookie
        // as parameter.

        HttpSessionCookie sessionCookie = null;

        if (cookie != null)               
        {
            sessionCookie = new HttpSessionCookie(cookie.getDomain(),
                cookie.getName(), cookie.getValue());
            sessionCookie.setComment(cookie.getComment());
            sessionCookie.setExpiryDate(cookie.getExpiryDate());
            sessionCookie.setPath(cookie.getPath());
            sessionCookie.setSecure(cookie.isSecure());
        }
               
        return sessionCookie;
    }
View Full Code Here

    /**
     * @see WebRequest#addCookie(String, String, String)
     */
    public void addCookie(String theDomain, String theName, String theValue)
    {
        addCookie(new Cookie(theDomain, theName, theValue));
    }
View Full Code Here

        Enumeration cookies = getCookies().elements();

        while (cookies.hasMoreElements())
        {
            Cookie cookie = (Cookie) cookies.nextElement();

            buffer.append("[" + cookie + "]");
        }

        return buffer.toString();
View Full Code Here

        org.apache.commons.httpclient.Cookie[] httpclientCookies =
            new org.apache.commons.httpclient.Cookie[cactusCookies.size()];

        for (int i = 0; i < cactusCookies.size(); i++)
        {
            Cookie cactusCookie = (Cookie) cactusCookies.elementAt(i);
            httpclientCookies[i] = CookieUtil.createHttpClientCookie(
                theRequest, theUrl, cactusCookie);
        }

        return httpclientCookies;
View Full Code Here

                int equalsChar = nameValue.indexOf("=");
                String name = nameValue.substring(0, equalsChar);
                String value = nameValue.substring(equalsChar + 1);
                if (name.equalsIgnoreCase(theTarget))
                {
                    return new Cookie(theConnection.getURL().getHost(),
                        name, value);
                }
            }
            key = theConnection.getHeaderFieldKey(++i);
        }
View Full Code Here

TOP

Related Classes of org.apache.cactus.Cookie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.