Re: [tools, struts1] On an HTTPS page, link to HTTP URL includes port number :443
Christopher Schultz <[email protected]> Tue, 09 Dec 2014 15:05:34 -0500
| Newsgroups | gmane.comp.jakarta.velocity.user |
|---|---|
| Message-ID | <[email protected]> |
Mike, On 12/6/14 9:21 AM, Mike Kienenberger wrote: > Glancing through this and through my own code, we were originally > using the SecureLinkTool which extends the StrutsLinkTool. > > But now I have a custom class that extends LinkTool and completely > encodes the resulting url afterwards as we completely rewrite the url > to a different format for a variety of other non-related reasons. > > If SecureLinkTool doesn't do what you want, I'd suggest you subclass > either SecureLinkTool or StrutsLinkTool to make it work the way you > want. Once you've done this, you just replace your "link" tool with > your new class -- no other changes required in your templates or in > the way you've been using $link. Thanks. I'm more likely to hack and fix the original StrutsLinkTool (or trace to the source and fix whatever that is). For the meantime, I'll use my ugly hack because it's only used in one place. Thanks, -chris > On Fri, Dec 5, 2014 at 8:20 PM, Christopher Schultz > <[email protected]> wrote: >> 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 >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
signature.asc
(application/pgp-signature, 859 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUh1YOAAoJEBzwKT+lPKRYVOoP/jGuAw/tLifmhUOWJSsw59tC mRQlARr4DkOx+jff5ocC6dAcVSPF+0Qh8bTP3Jm3beluBNPLmncoT5kigX9y/qih /3cDjdjYkjvS6fbRGj7QU7EjwipKOf2wV9pZS8zjgYeQ89VbfUgrBADpFDezXxMM MnfhnAUKvYnfeTsBw7iNzFihIhdMC9/wIbvo3skTEPP5Pb88lGlPOpuEJz4E3AKb 3uUwHg5SIAdaIenfGjPeQTYCKZ4BRaQt6zAFgUOUyNolfgIxMQXxCU92+AknjH9F U7nww/MuN6ff3ZaosdUt8Ci541f8Yg3G4Xa8gfBEU3UqShgVh5/N6RRFW3KrKR42 KvzbxYfZh4zpSC4QGgkPfARIuwpllKnYvDdwygIsLvZ2d80NQAmD+mEC96X0+Jj4 tgvVMaeV1bSBq/EIOe6EbigwQvXEERTqP/iuKaFvrgvdWpnwrbhA+oEDTyZVzedp h7+8BPpghY9xyJXMGu118YtMDRcA8tjhypYgOQdKOhOS6jgCdQQ+/r8V3goN2Ynf YeGa6MNMMXOvSoCIH1MJa1X3Cr5IUHNbuXnIZ8RxakOgNw8A3u/6ygwEoftKW6Sy CkwQp33JaGjdlg18UcvQzRsCzfYyimRCII0hwoRE8vEhLabsKjVpHzVet05FgFKf sqKhT2gRIg5zLE9M4My7 =qHiU -----END PGP SIGNATURE-----