本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.getHomePage()
方法的一些代码示例,展示了WebClient.getHomePage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.getHomePage()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:getHomePage
[英]Returns the client's current homepage.
[中]返回客户端的当前主页。
代码示例来源:origin: org.jvnet.hudson/htmlunit
/**
* Returns <tt>true</tt> if the specified URL is the web client's current
* homepage and the document calling the method is on the same domain as the
* user's homepage. Part of the <tt>#default#homePage</tt> default IE behavior
* implementation.
* @param url the URL to check
* @return <tt>true</tt> if the specified URL is the current homepage
*/
public boolean isHomePage(final String url) {
try {
final URL newUrl = new URL(url);
final URL currentUrl = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings().getUrl();
final String home = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient().getHomePage();
final boolean sameDomains = newUrl.getHost().equalsIgnoreCase(currentUrl.getHost());
final boolean isHomePage = (home != null && home.equals(url));
return (sameDomains && isHomePage);
}
catch (final MalformedURLException e) {
return false;
}
}
代码示例来源:origin: org.jenkins-ci/htmlunit
/**
* Returns <tt>true</tt> if the specified URL is the web client's current
* homepage and the document calling the method is on the same domain as the
* user's homepage. Part of the <tt>#default#homePage</tt> default IE behavior
* implementation.
* @param url the URL to check
* @return <tt>true</tt> if the specified URL is the current homepage
*/
public boolean isHomePage(final String url) {
try {
final URL newUrl = new URL(url);
final URL currentUrl = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings().getUrl();
final String home = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient().getHomePage();
final boolean sameDomains = newUrl.getHost().equalsIgnoreCase(currentUrl.getHost());
final boolean isHomePage = (home != null && home.equals(url));
return (sameDomains && isHomePage);
}
catch (final MalformedURLException e) {
return false;
}
}
代码示例来源:origin: net.disy.htmlunit/htmlunit
/**
* Returns <tt>true</tt> if the specified URL is the web client's current
* homepage and the document calling the method is on the same domain as the
* user's homepage. Part of the <tt>#default#homePage</tt> default IE behavior
* implementation.
* @param url the URL to check
* @return <tt>true</tt> if the specified URL is the current homepage
*/
public boolean isHomePage(final String url) {
try {
final URL newUrl = new URL(url);
final URL currentUrl = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings().getUrl();
final String home = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient().getHomePage();
final boolean sameDomains = newUrl.getHost().equalsIgnoreCase(currentUrl.getHost());
final boolean isHomePage = (home != null && home.equals(url));
return (sameDomains && isHomePage);
}
catch (final MalformedURLException e) {
return false;
}
}
代码示例来源:origin: org.jvnet.hudson/htmlunit
/**
* Causes the web client to navigate to the current home page. Part of the
* <tt>#default#homePage</tt> default IE behavior implementation.
* @throws IOException if loading home page fails
*/
public void navigateHomePage() throws IOException {
final WebClient webClient = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient();
webClient.getPage(webClient.getHomePage());
}
代码示例来源:origin: org.jenkins-ci/htmlunit
/**
* Causes the web client to navigate to the current home page. Part of the
* <tt>#default#homePage</tt> default IE behavior implementation.
* @throws IOException if loading home page fails
*/
public void navigateHomePage() throws IOException {
final WebClient webClient = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient();
webClient.getPage(webClient.getHomePage());
}
代码示例来源:origin: net.disy.htmlunit/htmlunit
/**
* Causes the web client to navigate to the current home page. Part of the
* <tt>#default#homePage</tt> default IE behavior implementation.
* @throws IOException if loading home page fails
*/
public void navigateHomePage() throws IOException {
final WebClient webClient = getDomNodeOrDie().getPage().getEnclosingWindow().getWebClient();
webClient.getPage(webClient.getHomePage());
}
内容来源于网络,如有侵权,请联系作者删除!