String queryString = null;
if (uriAndQuery.length > 1) {
queryString = uriAndQuery[1];
}
LinkResolver resolver = null;
try {
if (this.sourceResolver == null) {
this.sourceResolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
}
resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
String webappUrl = ServletHelper.getWebappURI(request);
LinkTarget target;
if (factory.isDocument(webappUrl)) {
Document currentDoc = factory.getFromURL(webappUrl);
target = resolver.resolve(currentDoc, linkUri);
}
else {
Link link = new Link(linkUri);
contextualize(link, webappUrl);
target = resolver.resolve(factory, link.getUri());
}
Document doc = target.getDocument();
if (target.isRevisionSpecified()) {