Custom File Extensions *

Hello,

Lucee 5.0 on Windows 2012 with IIS8.5

I am new to Lucee, first post to this group, and I just installed it today and testing to see if it can replace our large CF app. First off, I need to tell Lucee to process “.lf” files, which is what we name “.cfm” files.

I added a handler mapping in IIS , and now tomcat is replying to the request but Lucee is not processing it…

I tried adding a uriworkermap.properties file with the *.lf map but that did not work.
I tried adding a web.xml file under the website root > WEB-INF but that also did not work.

Does anyone know how to do this? There are a couple of unanswered threads asking about this…

Also, what I was curious about is, if I modify the web.xml and uriworkernap.properties to ADD “*.lf” do I also need to add everything else that is being handled automatically?

Any help appreciated! Thank you!

Brook

Hi Brook,

Did you install lucee with the boncode connector? Using uriworkermap.properties is for isapi_redirect.dll use. With boncode connector there shouldn’t be the need to edit the uriworkermap.properties file. I recommend installing Lucee with boncode connector. When installing lucee with the installer, it should ask you about boncode installation. I can really recommend that instead of ISAPI. For further reading about why, please read this http://www.boncode.net/boncode-connector

Then you usually need to do 3 things (when installed with boncode-connector):

  1. Add module-handler in IIS to point that .if files to lucee. That is as simple as copying/creating the .cfm/.cfc handler in the module handler section of IIS and changing the extension to “.if”

  2. Edit the path_to_tomcat/conf/web.cfm and add the url-pattern <url-pattern>*.if</url-pattern> in the servlet-mapping section of the CFMLServlet. It should look something like this afterwards:

   <servlet-mapping>
      <servlet-name>CFMLServlet</servlet-name>
      <url-pattern>*.cfc</url-pattern>
      <url-pattern>*.cfm</url-pattern>
      <url-pattern>*.cfml</url-pattern> 
      <url-pattern>/index.cfc/*</url-pattern>
      <url-pattern>/index.cfm/*</url-pattern>
      <url-pattern>/index.cfml/*</url-pattern>
      <url-pattern>*.if</url-pattern>
  </servlet-mapping>
  1. Add the mime-mapping in the path_to_tomcat/conf/web.cfm
<mime-mapping>
        <extension>if</extension>
        <mime-type>text/html</mime-type>
 </mime-mapping>

There is no need to add web.xml in the WEB-INF. I would stop lucee/tomcat service, delete the WEB-INF and start lucee/tomcat service again. Tomcat/Lucee will recreate that when restarted.

Hope that helps.

1 Like

Hi Andreas,

Thank you for the warm welcome and thank you for that advice. I do have the boncode connector installed. I thought maybe for this modification I would need to edit the web.xml and uriworkers… Thank you for setting me straight. I will try what you have suggested. I wonder why Adobe CF doesn’t use the Boncode connector

Thank you again for your help!

Brook

It was a pleasure.

For completeness of this thread, I’m posting this link here. Maybe it helps others coming from Adobe. I was also stuck with this a while ago :smiley:

2 Likes

You can modify your application.cfm if you need only to <cfinclude> your files:

<cfset THIS.compileextforinclude = “cfm,lf”>

Note: Specify the list of allowed file extensions as a comma-separated list for the cfinclude tag. Specifying a wildcard * in the list makes any file included using the cfinclude tag to be compiled. If any file included using the cfinclude tag is not found in this list, their content will be statically included. By default, files with the cfm and cfml extensions are always compiled irrespective of this setting.

this was introduced in CF11, I don’t think Lucee supports this (I searched the source code)?

Adobe’s connector is basically a custom AJP proxy. It predates Boncode and is customized to Adobe and their Tomcat customizations.

1 Like