当前位置: 首页>>代码示例>>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;未经允许,请勿转载。