[opencms-dev] External link to same host:port

Rodriguez, Adrian A.Rodriguez at comundus.com
Fri Mar 27 11:45:10 CET 2009

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, "/");






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




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:




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)?






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20090327/23ab90fe/attachment.html>

More information about the opencms-dev mailing list