當前位置: 首頁>>代碼示例>>Java>>正文


Java WebClient.setAjaxController方法代碼示例

本文整理匯總了Java中com.gargoylesoftware.htmlunit.WebClient.setAjaxController方法的典型用法代碼示例。如果您正苦於以下問題:Java WebClient.setAjaxController方法的具體用法?Java WebClient.setAjaxController怎麽用?Java WebClient.setAjaxController使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.gargoylesoftware.htmlunit.WebClient的用法示例。


在下文中一共展示了WebClient.setAjaxController方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Server

import com.gargoylesoftware.htmlunit.WebClient; //導入方法依賴的package包/類
public Server()throws IOException{
    browser = new WebClient(BrowserVersion.CHROME);
    problems = new ArrayList<>();
    done = false;
    isSubmitting = false;
    user_name = "XC2";
    pass_word = "donthackme";
    work_list = new ArrayList<>();
    users_data = new HashMap<>();
    application = Executors.newCachedThreadPool();
    //the buffer can be 100 at max (may be adjusted if needed)
    buffer_queue = new LinkedBlockingQueue<>(100);
    
    
    //some browser intitialization to increase efficiency (the cookies part is essential)
    browser.getOptions().setUseInsecureSSL(true);
    browser.getOptions().setJavaScriptEnabled(false);
    browser.getOptions().setCssEnabled(false);
    browser.getOptions().setThrowExceptionOnScriptError(false);
    browser.getCookieManager().setCookiesEnabled(true);
    browser.setAjaxController(new NicelyResynchronizingAjaxController());
}
 
開發者ID:AmrSaber,項目名稱:XC2,代碼行數:23,代碼來源:Server.java

示例2: create

import com.gargoylesoftware.htmlunit.WebClient; //導入方法依賴的package包/類
public static WebClient create(String host,int port) {
	LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log",
			"org.apache.commons.logging.impl.NoOpLog");
	java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(
			Level.OFF);
	java.util.logging.Logger.getLogger("org.apache.http.client").setLevel(
			Level.OFF);

	// LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log","org.apache.commons.logging.impl.NoOpLog");
	// java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF);

	WebClient webClient = new WebClient(BrowserVersion.FIREFOX_17,host,port);
	webClient.getOptions().setUseInsecureSSL(true);
	webClient.getOptions().setJavaScriptEnabled(true);
	webClient.getOptions().setThrowExceptionOnScriptError(false);
	webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
	webClient.getOptions().setCssEnabled(true);
	webClient.setAjaxController(new NicelyResynchronizingAjaxController());
	webClient.getOptions().setTimeout(60000);
	webClient.setJavaScriptTimeout(60000);
	webClient.waitForBackgroundJavaScript(120000);
	return webClient;
}
 
開發者ID:xiaomin0322,項目名稱:alimama,代碼行數:24,代碼來源:HtmlUnitUtil.java

示例3: Server

import com.gargoylesoftware.htmlunit.WebClient; //導入方法依賴的package包/類
public Server()throws IOException{
    browser = new WebClient(BrowserVersion.CHROME);
    problems = new ArrayList<>();
    done = false;
    isSubmitting = false;
    user_name = "XC2";
    pass_word = "donthackme";
    application = Executors.newCachedThreadPool();
    //the buffer can be 100 at max (may be adjusted if needed)
    buffer_queue = new LinkedBlockingQueue<>(100);
    network = new Network_Server(this, this.port, this.max_clients);
    
    //some browser intitialization to increase efficiency (the cookies part is essential)
    browser.getOptions().setUseInsecureSSL(true);
    browser.getOptions().setJavaScriptEnabled(false);
    browser.getOptions().setCssEnabled(false);
    browser.getOptions().setThrowExceptionOnScriptError(false);
    browser.getCookieManager().setCookiesEnabled(true);
    browser.setAjaxController(new NicelyResynchronizingAjaxController());
}
 
開發者ID:AmrSaber,項目名稱:XC2,代碼行數:21,代碼來源:Server.java

示例4: newClient

import com.gargoylesoftware.htmlunit.WebClient; //導入方法依賴的package包/類
protected static WebClient newClient()
{
    final WebClient webClient = new WebClient();
    webClient.getOptions().setJavaScriptEnabled( false );
    webClient.getOptions().setCssEnabled( false );
    webClient.getOptions().setAppletEnabled( false );
    webClient.getOptions().setThrowExceptionOnFailingStatusCode( false );
    webClient.setAjaxController( new NicelyResynchronizingAjaxController() );
    return webClient;
}
 
開發者ID:ruikom,項目名稱:apache-archiva,代碼行數:11,代碼來源:AbstractRepositoryServletTestCase.java


注:本文中的com.gargoylesoftware.htmlunit.WebClient.setAjaxController方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。