I am creating a simple custom error page for my JSP application that is running on tomcat 7. I am having an issue printing the exception. The exception variable when printed:
<%= exception %> 
is always null.
web.xml
<error-page>
  <error-code>404</error-code>
   <location>/error.jsp</location>
</error-page>
<error-page>
  <error-code>500</error-code>
  <location>/error.jsp</location>
</error-page>
<error-page>
  <exception-type>java.lang.Exception</exception-type>
  <location>/error.jsp</location>
</error-page>
error.jsp
<%@ page isErrorPage="true" import="java.io.*" %>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
  <title>Error Page</title>
  </head>
  <body>
     <div>
       <h3>Error</h3> 
       <h4><b>Exception:</b><br></h4> 
       <p><i><%= exception %></i><p>
     </div>
     <footer></footer>
  </body>
Directive
I also added:
<%@ page errorPage="errorPage.jsp" %>
to all of my pages.
Error
When this runs it just will print null for the exception variable. If I try and change it to
    exception.printStackTrace(response.getWriter() 
I will get an error that looks like this:
SEVERE: Exception Processing ErrorPage[errorCode=404, location=/error.jsp]
org.apache.jasper.JasperException: /error.jsp (line: 1, column: 32) equal symbol expected
 
    