Skip to main content
Inspiring
February 23, 2011
Question

Issue processing htm as cfm

  • February 23, 2011
  • 3 replies
  • 1991 views

Running Win2k8 64-bit, IIS 7, CF 9 Ent (multi-server config).

I'm trying to process htm files as cfm files but no matter what I do  it just displays the CF code (not rendered).

I've edited my web.xml as such:

<servlet-mapping>

            <servlet-name>CfmServlet</servlet-name>

            <url-pattern>*.htm</url-pattern>

        </servlet-mapping>

        <servlet-mapping>

            <servlet-name>CfmServlet</servlet-name>

            <url-pattern>*.html/*</url-pattern>

    </servlet-mapping>

BTW, the web.xml is located here, C:\JRun4\servers\TestInstance\cfusion.ear\cfusion.war\WEB-INF\

I then went into IIS and edited the Handler Mappings for the "TestInstance" website by doing the following:

1) clicked on "add module mapping"

2) request path: *.htm

3) module: ServerSideIncludeModule

4) name: SSI-Inc (left Executable blank, but also tried specifying C:\JRun4\lib\wsconfig\jrun_iis6.dll with same result)

5) request restrictions: mapping > file; verbs > Post, GET; access > script

When I click on view ordered list my *.htm handler mapping is listed first at the top.

Any thoughts?

I had this working on CFMX 6.1 and IIS 6, FWIW.

TIA

    This topic has been closed for replies.

    3 replies

    Community Expert
    February 28, 2011

    The new handler mapping should be identical to the ones that already exist for CF files. I don't think yours is.

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Dave Watts, Eidolon LLC
    Legend
    February 23, 2011

    As the previous poster mentioned, you need to configure IIS to use CF when serving htm pages. You also need to update the java config file so it know what to do when an htm file is handed to it. The IIS side is fairly easy, simply copy the .cfm line as a .htm line for the site. The Java side, you need to duplicate a handler block within the xml file but I can't think of the name of the file right now. Google "Coldfusion processing .htm files" and you should find the info.

    From your original post, it appears you might just be missing the Java side of the config.

    BalanceAuthor
    Inspiring
    February 23, 2011

    @Steve - is this any different than what I described in my original post?

    I then went into IIS and edited the Handler Mappings for the "TestInstance" website by doing the following:

    1) clicked on "add module mapping"

    2) request path: *.htm

    3) module: ServerSideIncludeModule

    4) name: SSI-Inc (left Executable blank, but also tried specifying C:\JRun4\lib\wsconfig\jrun_iis6.dll with same result)

    5) request restrictions: mapping > file; verbs > Post, GET; access > script

    Thanks

    Legend
    February 23, 2011

    Yes, you are missing the Java servelette mapping. Here is an article I found using Google: http://www.talkingtree.com/blog/index.cfm/2006/2/17/CF-Custom-File-Extensions

    12Robots
    Participating Frequently
    February 23, 2011

    Since you are going through IIS you need to tell IIS to pass .htm files to CF for processing. I think it is a setting in "Handler Mappings" but I have never done.  I know how to do it in Apache, but that is probably less helpful

    BalanceAuthor
    Inspiring
    February 23, 2011

    Eh, right, I've already added the Handler Mapping, per my original post