Getting the right servlet context parameters
In the deployment descriptor, web.xml, you should specify the fully qualified names of the subject file:
<context-param>
<param-name>oa4mp:server.error.subject</param-name>
<param-value>/var/www/config/errorSubject.template</param-value>
</context-param>
The typical contents of such a file would be
Error caught by ${servletEngine} on ${host}
in while the ${servletEngine} (e.g. Tomcat, Jetty) and ${host} would be replaced by their runtime values.
The body of the generated email message is specified in much the same way:
<context-param>
<param-name>oa4mp:server.error.message</param-name>
<param-value>/var/www/config/errorMessage.template</param-value>
</context-param>
And a typical example would be
An exception was encountered.
Error Report:
------------
Error: ${message}
Host: ${host}
Client: ${client}
Servlet: ${servlet}
URL: ${url}
Cookies:
-------
${cookies}
Exception:
---------
${stacktrace}
where the following values hold:
- ${message} is the message in the stack trace
- ${host} is the name of the server
- ${client} is the identifier of the client that made the request
- ${servlet} is the name of the servlet (e.g. CertServlet) where the exception was encountered
- ${url} is the url of the request
- ${cookies} is a list of every cookie that the servlet has access to
- ${stacktrace} is the full stacktrace of the exception.