From: <bra...@us...> - 2009-11-06 03:19:40
|
Revision: 2903 http://archive-access.svn.sourceforge.net/archive-access/?rev=2903&view=rev Author: bradtofel Date: 2009-11-06 03:19:32 +0000 (Fri, 06 Nov 2009) Log Message: ----------- FEATURE: now displays alternate URLs users can try, primarily useful with exactHostMatch AccessPoint property 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 2009-11-06 03:15:50 UTC (rev 2902) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2009-11-06 03:19:32 UTC (rev 2903) @@ -1,12 +1,18 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.List" %> <%@ page import="org.archive.wayback.exception.WaybackException" %> +<%@ page import="org.archive.wayback.exception.ResourceNotInArchiveException"%> <%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% UIResults results = UIResults.extractException(request); WaybackException e = results.getException(); e.setupResponse(response); +String contextRoot = results.getWbRequest().getContextPrefix(); + %> + <jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> <% @@ -16,4 +22,24 @@ <h2><%= fmt.format(e.getTitleKey()) %></h2> <p><b><%= fmt.format(e.getMessageKey(),e.getMessage()) %></b></p> +<% +if(e instanceof ResourceNotInArchiveException) { + ResourceNotInArchiveException niae = (ResourceNotInArchiveException) e; + List<String> closeMatches = niae.getCloseMatches(); + if(closeMatches != null && !closeMatches.isEmpty()) { +%> + Other requests to try:<br> +<% + WaybackRequest tmp = results.getWbRequest().clone(); + for(String closeMatch : closeMatches) { + tmp.setRequestUrl(closeMatch); + String link = tmp.getContextPrefix() + "query?" + + tmp.getQueryArguments(); +%> + <a href="<%= link %>"><%= closeMatch %></a><br> +<% + } + } +} +%> <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. |