Web Trenches

Processing HTML, HTM (or other) files in ColdFusion 10

I was recently working on a legacy ColdFusion application that required .html and .htm files to be processed with ColdFusion.  The application currently runs on ColdFusion 9 and we are preparing it for ColdFusion 10.  To accomplish the processing of .html files with ColdFusion, we had always followed the method of editing the web.xml file and adjusting the ISAPI filter in IIS.  However, this was not enough in ColdFusion 10.  In CF10, there is now an additional step that is required due to TomCat.

Steps to set this up…

  1. Set up IIS and the connectors as previously documented.  Instructions from Peter Bell
  2. Go to the uriworkermap.properties file for your ColdFusion10 install
    • The normal path to this is <cf root>/config/wsconfig/1/uriworkermap.properties
  3. Copy the line /*.cfm = cfusion and create new lines at the bottom of the file as follows for each extension you want ColdFusion to process. /*.html = cfusion
    /*.htm = cfusion 
  4. Save uriworkermap.properties and restart your ColdFusion 10 service.



18 Replies to “Processing HTML, HTM (or other) files in ColdFusion 10”

  1. Thank you for this! This was the only reference I could find on the web regarding this change due to TomCat.

  2. Nice tips.I think this steps will help to those who is involved in ColdFusion application & running several test via this application. This steps will really help for the newbies who is basically deal with the app development.

  3. I know it’s been a while since this blog entry was posted but I am seeing this message in the cf error log several times a day.

    Oct 25, 2013 7:12:43 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [CfmServlet] in context with path [/] threw exception [ROOT CAUSE:
    ] with root cause
    javax.servlet.ServletException: ROOT CAUSE:

    at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70)
    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

    I have this is the web.xml





    And this in the uriworkermap.properties

    /*.html = cfusion
    /*.htm = cfusion

    Is the problem possibly mapping 16 and 18?

  4. @Jeff – I’m not sure I understand the problem you are presenting. I understand that the error is showing in the error logs, but are HTML and HTM files displaying correctly? You said you see the error several times a day, but it is not clear if you are just seeing this in the logs, or if the pages really aren’t working.

  5. I’m sorry Michael. Yes, the pages are displaying. I am just seeing the messages in the logs and am not sure if mappings in web.xml.

  6. Should have ended “I am just seeing the messages in the logs and am not sure if CfmServlet mappings 16 and 18 in web.xml are the cause.”

  7. Jeff, I don’t think this is related, but I can’t say with 100% confidence. I am not getting those errors, and I do have the same mappings as you. Given that the pages are working correctly, I think it is unlikely that those mappings are causing the error. Is there anything in the other CF log files that corresponds to these errors (same date/time)?

  8. What I am wondering is does the uriworkermap.properties also need

    /*.html/* = cfusion
    /*.htm/* = cfusion

    Like it does for cfm and cfml.

    Right now I just have

    /*.html = cfusion
    /*.htm = cfusion

    So it is not a one to one match with the web.xml cfmServlet entries.

  9. It would only need those mappings if you are processing URLs like this…


    In other words, if you want it to process parts of the URI past the .html.

    Adding those into uriworkermap.properties won’t hurt anything. Or, if you don’t want URLs processed like that, then remove the *.html/* mappings from web.xml.

    I don’t know for sure that the error is related, but it won’t hurt anything to add (or remove) those entries and try it.

  10. Thanks Mike. Trying to eliminate obvious or semi-obvious possibilities from the puzzle as the error message is not specific about the cause at all. At least not to me. I appreciate your help.

  11. Thanks for this helpful article. Helped immensely with my conversion to CF 11. Only lingering problem I have is this:

    My default doc is index.htm which has CF code in it and CF is executing, but when I go to the site root http://mysite.com/ without specifying the file, the contents of index.htm displays but is not executed by CF. Do I need an additional entry in my uriworkermap.properties file?

  12. @Frank – Sorry, but I’m not sure what would cause that. Maybe confirm that index.htm is in the welcome-file-list at the bottom of web.xml? This is an old article and I am on CF11 now, so I can’t really test it.

  13. @Tony – I don’t think it is possible to have directories process through ColdFusion. I think you might want to look into using a rewrite rule for that. So, /pages/page would actually rewrite to /something.cfm. It wouldn’t be visible to the end user.

    If you use IIS as your web server, I could show you an example of that.

    Otherwise, you might be able to set index.cfm as a default page, and then /pages/page should pull up /pages/page/index.cfm. However, I think that is visible to the end user.

  14. I had the problem that Frank had, where the .html files were working fine in CF but going to the site root, or a directory, was crashing. It would find index.html, but show an IIS 500.0 error.
    I fixed it by going to the ISAPI Filters icon in IIS and adding a tomcat2 entry with my isapi_redirect.dll path, making sure that the site id number was right.

Leave a Reply

Your email address will not be published. Required fields are marked *