<%@ page isErrorPage="true" import="com.arsdigita.dispatcher.DispatcherHelper" import="com.arsdigita.templating.WrappedTransformerException" import="com.arsdigita.templating.Templating" import="javax.xml.transform.TransformerException" import="javax.xml.transform.SourceLocator" import="java.util.Iterator" import="java.util.Collection" %><% DispatcherHelper.forceCacheDisable(response); %> <%-- NB. The above cacheDisable command must be on the first line of the jsp since the header must be written before any data is output --%> <% String genericErrorMessage = "

An unexpected error has occurred. If this continues to be a problem for you please contact the administrators of the site quoting the following:

"; String xslErrorString = "

An unexpected error has occurred when trying to parse the XSL templates. The error is presented below. If this continues to be a problem for you please contact the administrators of the quite quoting the CCM issue report code.

"; if (exception != null && (exception instanceof WrappedTransformerException)) { Collection errors = (Collection)request.getAttribute(Templating.FANCY_ERROR_COLLECTION); if (errors != null) { Iterator iter = errors.iterator(); out.println(xslErrorString); int count = 1; int totalErrors = errors.size(); while(iter.hasNext()) { TransformerException ex = (TransformerException)iter.next(); out.println("XSL Error " + count + " of " + totalErrors + "
"); out.println("Message: " + ex.getMessage() + "
"); count++; SourceLocator locator = ex.getLocator(); Throwable root = ex.getCause(); if (root == null) { root = ex.getException(); } if (root != null) { out.println("Cause: " + root.getMessage() + "
"); } out.println("Location: " + ex.getLocationAsString() + "
"); if (locator != null) { out.println("Line: " + locator.getLineNumber() + "
"); out.println("Column: " + locator.getColumnNumber() + "
"); } out.println("

"); } } else { out.println(genericErrorMessage); } } else { out.println(genericErrorMessage); } %>