[tools, struts1] On an HTTPS page, link to HTTP URL includes port number :443

Christopher Schultz <[email protected]> Fri, 05 Dec 2014 20:20:28 -0500
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <[email protected]>
All,

I'm using StrutsLinkTool and I have a "forward" defined in
struts-config.xml that is a complete URL (like
"http://www.google.com/?q=foo"). In my page, I have this:

<a href="$link.forward('my-link-name')">link text</a>

The page this link is on is served via HTTPS with no port number, so of
course I'm using the default port number for TLS (:443). In the page
source, the link looks like this:

<a href="http://www.google.com:443/?q=foo">link text</a>

The link is unfollowable because the server (not actually google.com)
returns a 400 response because of the HTTP protocol being used on an
HTTPS port. :(

Is there a way to suppress the port number in this URL? I believe
[Struts]LinkTool is adding it because of the port number of the current
request.

Technically speaking, this is a URL that we can simply specify directly
in the page, but it's nice to have it configured via struts-config.xml
to have all our "forwards" defined in one place.

Thanks,
-chris
signature.asc (application/pgp-signature, 859 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUglncAAoJEBzwKT+lPKRYkEMQAJ8A+9NYeeHIi9vKqApDtd3j
HDfvldQZpxglFdR1dzEDfSEKibbXkt9fa3DhlhqtbfjI4jjN0udOGEKw2341qIcd
zkfP/QoYjZtqOrkiZpWhBxAJodaWRwhd8jNDUvm54HGAI7nbn0K5/bjvUFVK+bfX
Bn0n7VP/eU1VUUNjPby4uRlpwYNSdbSQ4BHyp0mEWOeJ0sCRNjNLsWjXtGZ8pji1
dVFtn0edKipdYGCs7xY12N5gWKrD8n3BrYdKgGuuMxZQfY0r3ZO0EE64iFcKPZmx
dgQYl/HvnXFY1Pcdt8juz1iHtJWS+rOpYTcHKh3FQqXJxgUt74e+XwL3CLdAqy9H
NnrsR8KjIUH0JuExjEYzJglq1xItnAztxzvQG6U5hmDJAiszX/dTugGLoy0mwLSw
UIqMcbJc6R9dTPq9pV67KhsRvVfZ97vI+4rcLoIacP5TRBBJ0k1hr+17AOlyvywx
rm3cSwLWQ+rQaPHnj//741At0HP3jvSWwY66dwE+tWFJeGEkOPEMPczMOAjq8m+k
P3nFFeHY9+vu5IztcE/15cyBlSJPMUCKbzSuqNudOIyeuIdo2kJEEOul3bh/JXAy
n59wiyk54bP92synKs2ZdKSE81XFqpvRFmGepn/Tp2E4j8r/ucF06wZM/IlDAeck
fGlKo61/9l3gk3EYV/V6
=fUOi
-----END PGP SIGNATURE-----