/** * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property * {@link WebClient#setThrowExceptionOnFailingStatusCode(boolean)} is set to true */ private void loadInnerPageIfPossible(final String src) throws FailingHttpStatusCodeException { setContentLoaded(); if (!src.isEmpty()) { final URL url; try { url = ((HtmlPage) getPage()).getFullyQualifiedUrl(src); } catch (final MalformedURLException e) { notifyIncorrectness("Invalid src attribute of " + getTagName() + ": url=[" + src + "]. Ignored."); return; } if (isAlreadyLoadedByAncestor(url)) { notifyIncorrectness("Recursive src attribute of " + getTagName() + ": url=[" + src + "]. Ignored."); return; } try { final WebRequest request = new WebRequest(url); request.setCharset(getPage().getCharset()); request.setAdditionalHeader(HttpHeader.REFERER, getPage().getUrl().toExternalForm()); getPage().getEnclosingWindow().getWebClient().getPage(enclosedWindow_, request); } catch (final IOException e) { LOG.error("IOException when getting content for " + getTagName() + ": url=[" + url + "]", e); } } }
notifyIncorrectness("Invalid src attribute of " + getTagName() + ": url=[" + src + "]. Ignored."); return; notifyIncorrectness("Recursive src attribute of " + getTagName() + ": url=[" + src + "]. Ignored."); return; LOG.error("IOException when getting content for " + getTagName() + ": url=[" + url + "]", e);
url = ((HtmlPage) frame.getEnclosedPage()).getFullyQualifiedUrl(src); } catch (final MalformedURLException e) { String message = "Invalid src attribute of " + frame.getTagName() + ": url=[" + src + "]. Ignored."; final IncorrectnessListener incorrectnessListener = webClient.getIncorrectnessListener(); String message = "Recursive src attribute of " + frame.getTagName() + ": url=[" + src + "]. Ignored."; final IncorrectnessListener incorrectnessListener = webClient.getIncorrectnessListener(); log.error("Error when getting content for " + frame.getTagName() + " with src=" + url, e);