StringBuilder link = new StringBuilder();
boolean changedScheme = false;
// FIXME: temporary hack until class is made a properly injected bean
Container cont = ActionContext.getContext().getContainer();
int httpPort = Integer.parseInt(cont.getInstance(String.class, StrutsConstants.STRUTS_URL_HTTP_PORT));
int httpsPort = Integer.parseInt(cont.getInstance(String.class, StrutsConstants.STRUTS_URL_HTTPS_PORT));
// only append scheme if it is different to the current scheme *OR*
// if we explicity want it to be appended by having forceAddSchemeHostAndPort = true
if (forceAddSchemeHostAndPort) {
String reqScheme = request.getScheme();