[opencms-dev] How do I link to tomcat applications outside of Opencms?
Kai Widmann
Widmann at mediaworx.de
Wed Sep 22 09:28:28 CEST 2021
Hey Ivan,
there might be an easier way without changing the LinkSubstitutionHandler. Just edit your WEB-INF/web.xml file, find the filter node „OpenCmsUrlServletFilter“, usually there is a commented out section „additionalExcludePrefixes“ that you can use to get what you want. That’s how it looks at one of my systems:
<!-- Use the OpenCmsUrlServletFilter to remove the OpenCms servlet name from URLs.
When using the filter make sure to also adjust the file /WEB-INF/config/opencms-importexport.xml setting
opencms/importexport/staticexport/rendersettings/vfs-prefix to ${CONTEXT_NAME}. -->
<filter>
<filter-name>OpenCmsUrlServletFilter</filter-name>
<filter-class>org.opencms.main.OpenCmsUrlServletFilter</filter-class>
<!-- Use the init-param to prevent rewriting for URI that start with the provided prefixes -->
<init-param>
<param-name>additionalExcludePrefixes</param-name>
<param-value>/cmisatom|/ideConnector|/assets|/flags|/tracking|/offline-resources</param-value>
</init-param>
</filter>
Maybe you can use this as well.
Cheers
Kai
Am 22.09.2021 um 07:49 schrieb Michael Emmerich <m.emmerich at alkacon.com<mailto:m.emmerich at alkacon.com>>:
Hello Ivan,
by default, OpenCms identifies those kind of links as "internal". But there is a way to define exclusion, paths that will be seen as "external" in OpenCms. Here is what to do:
1) In the opencms-importexport.xml config file, replace the line
<linksubstitutionhandler>org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler</linksubstitutionhandler>
with
<linksubstitutionhandler>org.opencms.staticexport.CmsAdvancedLinkSubstitutionHandler</linksubstitutionhandler>
2) In your OpenCms, there is a file /system/config/linkexcludes/
in it, you can define those paths that are no identified as non-OpenCms, e.g. external to the application.
Example: Your OpenCms runs as the ROOT-Webappliciiton at https://www.myserver.com<https://www.myserver.com/>
Therefore everything starting with "https://www.myserver.com"<https://www.myserver.com/> will be seen as an internal Link in OpenCms. When you now do the configuration as above ans add "/myexternalapp" to the /system/config/linkexcludes/ config file,
https://www.myserver.com/myexternalapp will not be seens as an internal OpenCms link.
Hope this helps,
Michael
Am 21.09.21 um 17:34 schrieb Ivan Drinks Sr:
I have other applications running in the same Tomcat instance as Opencms. Opencms is my ROOT application. I cannot create an external link to the other Tomcat applications because Opencms sees everything relative to it and states resource not found. How to I connect to my other Tomcat applications?
Thanks for your help.
Ivan Sr
_______________________________________________
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
https://lists.opencms.org/mailman/listinfo/opencms-dev
--
Michael Emmerich
Alkacon Software GmbH & Co. KG - The OpenCms Experts
http://www.alkacon.com<http://www.alkacon.com/> - http://www.opencms.org<http://www.opencms.org/> Co. KG - The OpenCms Experts
_______________________________________________
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
https://lists.opencms.org/mailman/listinfo/opencms-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.opencms.org/pipermail/opencms-dev/attachments/20210922/837c1c71/attachment.htm>
More information about the opencms-dev
mailing list