Code example for HttpContext

Methods: setAttribute

0
		// Create local HTTP context 
	    httpContext = new BasicHttpContext();
	    // Create a local instance of cookie store 
	    CookieStore cookieStore = new BasicCookieStore();
	    // Bind custom cookie store to the local context 
	    httpContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
		 
	} 
	 
	public HttpContext getHttpContext(){
		return httpContext;
	} 
	 
	public CookieStore getCookieStore(){
		return (CookieStore) getHttpContext().getAttribute(ClientContext.COOKIE_STORE);
	} 
	 
	public static FriendlyWagerContext getInstance() { 
		if (instance == null) instance = new FriendlyWagerContext ();
		return instance;
	}