Uploaded image for project: 'Lucee Development'
  1. LDEV-694

Make Apache/IIS virtual directories available for Lucee


    • Type: Enhancement
    • Status: Public consultation
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s:,
    • Fix Version/s: None
    • Sprint:


      Orig title: Include the mappings set in the servlet engine, when resolving file paths

      Being part of the mod_cfml team, I added some code to mod_cfml (github link), which copies the mappings set in the frontend server, to the backend Tomcat server, to make them available for Lucee / other cfml engines.
      Unfortunately, Lucee does not currently notice these extra mappings, when resolving file paths.

      Apache Tomcat has the option of adding extra resource paths to a web context. These are named "aliases" in tomcat 7, and "web resources" in tomcat 8. In Apache httpd server, they are called "aliases", and "virtual directories" in IIS.

      As an example, imagine a website site1.com, with the root path /web/site1/webroot/, and extra resources at site1.com/shared/, which are on disk at /web/shared/

      The website would then be configured in Tomcat 8 like this:

      <Host name="site1.com" appBase="webapps">
        <Context docBase="/web/site1/webroot/">
          <Resources className="org.apache.catalina.webresources.StandardRoot">
            <PreResources base="/web/shared" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/shared" internalPath="/" />

      Tomcat does see the resources, as can be tested from a cfml page with the following code:

      <cfdump eval="getPageContext().getServletContext().getRealPath('/shared/')"/>

      The cfdump would return /web/shared/.
      Lucee, on the other hand, would display /web/site1/webroot/shared/ when trying to access /shared/.

      My enhancement request is, to have Lucee use the mappings in the servlet context.
      Maybe this can be done by actualy copying the defined mappings from the servlet context?
      Otherwise, checking the result of getPageContext().getServletContext().getRealPath( realPath ) should work. I made a non-working sketch-up of how I see this here: https://github.com/paulklinkenberg/Lucee/commit/cabeaf85cff38cc55901489057d88e12d7c610b9

      btw: this feature would make the mod_cfml connector equal to the ACF "magic" connector




            • Assignee:
              frinky Paul Klinkenberg
            • Votes:
              7 Vote for this issue
              8 Start watching this issue


              • Created: