[opencms-dev] External link to same host:port
Pere Torrodellas
ptorrodellas at fihoca.com
Mon Mar 30 10:07:23 CEST 2009
Hello Adrian, thanks very much for your suggestion.
I hope, though, that someone knows how to do it without having to revert to coding, because it's something that seems pretty normal: to directly define an EXTERNAL link with an URL in the form needed to access the EXTERNAL resource without interference from OpenCMS.
Regards,
Pere
----- Original Message -----
From: Rodriguez, Adrian
To: The OpenCms mailing list
Sent: Friday, March 27, 2009 12:45 PM
Subject: Re: [opencms-dev] External link to same host:port
Hello Pere,
The following code snippet should give you a string of the form http://myhost.sample:8000/ . Let us know if it does the work for you.
CmsObject cms;
CmsSiteManager.getCurrentSite(cms).getServerPrefix(cms, "/");
Regards,
_________________________________________
Adrián Rodríguez
Junior IT-Berater
comundus GmbH
Schüttelgrabenring 3, D-71332 Waiblingen
Telefon +49 7151-50028-20
E-Mail a.rodriguez at comundus.com
Internet www.comundus.com
Geschäftsführer Klaus Hillemeier
Amtsgericht Stuttgart, HRB 264290
comundus ist ein Unternehmen der IT EXCELLENCE Group
_________________________________________
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Pere Torrodellas
Sent: Friday, March 27, 2009 9:44 AM
To: OpenCms Mail List
Subject: [opencms-dev] External link to same host:port
Hello,
I need to create an OpenCMS External Link for our navigation menu to point to another application in the same server, without specifying the host:port because it must work in different hosts. In a regular html page I can do this with a link of the form:
<a href="../myOtherApplication">My Link</a>.
and in a regular jsp with:
response.sendRedirect("../myOtherApplication");
The trouble is that unless I specifically include html://myHost:myPort in the External Link, OpenCms insists in prepending "/opencms/opencms/..." to whatever I put in the Link URL, so it doesn't work.
Being an EXTERNAL link, shouldn't OpenCms use the URL as defined, without any change? Can someone suggest how to solve this (other than with an ugly patch in the navigation menu building code)?
Thanks!
Pere
------------------------------------------------------------------------------
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090330/2f619fd8/attachment.htm>
More information about the opencms-dev
mailing list