From: <bra...@us...> - 2010-04-14 21:50:39
|
Revision: 3046 http://archive-access.svn.sourceforge.net/archive-access/?rev=3046&view=rev Author: bradtofel Date: 2010-04-14 21:50:33 +0000 (Wed, 14 Apr 2010) Log Message: ----------- FEATURE: NotInArchive error page now may provide link to url prefix search in parent directory of missing resource Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-04-14 21:44:57 UTC (rev 3045) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-04-14 21:50:33 UTC (rev 3046) @@ -5,12 +5,14 @@ <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> +<%@ page import="org.archive.wayback.util.url.UrlOperations" %> <% UIResults results = UIResults.extractException(request); WaybackException e = results.getException(); +WaybackRequest wbr = results.getWbRequest(); e.setupResponse(response); -String contextRoot = results.getWbRequest().getContextPrefix(); - +String contextRoot = wbr.getContextPrefix(); +String requestUrl = wbr.getRequestUrl(); %> <jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> @@ -28,9 +30,10 @@ List<String> closeMatches = niae.getCloseMatches(); if(closeMatches != null && !closeMatches.isEmpty()) { %> - Other requests to try:<br> + <p> + Other possible close matches to try:<br></br> <% - WaybackRequest tmp = results.getWbRequest().clone(); + WaybackRequest tmp = wbr.clone(); for(String closeMatch : closeMatches) { tmp.setRequestUrl(closeMatch); String link = tmp.getContextPrefix() + "query?" + @@ -40,6 +43,23 @@ <% } } + String parentUrl = UrlOperations.getUrlParentDir(requestUrl); + if(parentUrl != null) { + WaybackRequest tmp = wbr.clone(); + tmp.setRequestUrl(parentUrl); + tmp.setUrlQueryRequest(); + String link = tmp.getContextPrefix() + "query?" + + tmp.getQueryArguments(); + String escapedLink = fmt.escapeHtml(link); + String escapedParentUrl = fmt.escapeHtml(parentUrl); + %> + </p> + <p> + More options:<br></br> + Try Searching all pages under <a href="<%= escapedLink %>"><%= escapedParentUrl %></a> + </p> + <% + } } %> <jsp:include page="/WEB-INF/template/UI-footer.jsp" flush="true" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |