Refactor to reduce code duplication

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1514291 13f79535-47bb-0310-9956-ffa450edef68
Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=55399
Base i18n of error reports on request locale rather than default server local.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1514305 13f79535-47bb-0310-9956-ffa450edef68