errorUrl = errorUrl.substring(httpRequest.getContextPath().length());
String servletPath = httpRequest.getServletPath();
if (!errorUrl.startsWith(servletPath))
{
prepender.prepend(servletPath.substring(1) + "/");
}
for (int i = servletPath.length() + 1; i < errorUrl.length(); i++)
{
if (errorUrl.charAt(i) == '?')
{