PageA is actually the requested one and the web container cannot resolve
the base url properly
*/
UrlRenderer urlRenderer = RequestCycle.get().getUrlRenderer();
Url relativeUrl = Url.parse(url);
String fullUrl = urlRenderer.renderFullUrl(relativeUrl);
String encodedFullUrl = httpServletResponse.encodeURL(fullUrl);
final String encodedRelativeUrl;
if (fullUrl.equals(encodedFullUrl))
{
// no encoding happened so just reuse the relative url