<html>
<%@ page import="java.io.*, java.sql.SQLException, faqapp.utils.Constants" isErrorPage="true"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-1.0.2" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-1.0.2" prefix="html" %>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/utiltaglib.tld" prefix="util" %>

<%-- Include common page header with navigation bar --%>
<c:set var="tab" value="error"/>
<%@ include file="header.jsp" %>

<%--
Check if exception is database related exception,and if so, link to 
Readme/Setup instructions
--%>
<% if (exception instanceof SQLException || exception instanceof IOException) { %>
<H3><bean:message key="error.databaseOrIO"/></H3>
<P><bean:message key="error.databaseOrIODetail"/></P>
<bean:message key="error.link.readme"/><br><br>
<% } 
   else
   {
%>
<H3><bean:message key="error.generic"/></H3>
<%
   }
%>

<b><bean:message key="error.exceptionMessage"/></b>
<br></br>
<%=exception.getMessage()%>

<%-- 
Put the exception which is provided to this page in the users Session and 
display the link page for the exception to be displayed in more detail.
--%>
<% session.setAttribute(Constants.THROWNEXCEPTION,exception); %>
<P align="center">
  <html:link page="/showStackTrace.do">
    <bean:message key="error.link.showStackTraceLink"/>
  </html:link>
</P>

<%-- Include common page footer with Last Modified timestamp --%>
<%@ include file="footer.jsp" %>
</html>
