[NEXUS-7558] simple errors fix baseurl calculation

https://issues.sonatype.org/browse/NEXUS-7558

Encodes strings given to render error pages.

Aslo fixes baseUrl calculation which was messed up and not actually returning the proper base url when calculating from request.
I probably bring it back using deprecated method for now, though we may want to consider updating places where this is used to sendError and leave all this up to the error page servlet.