Skip to main content
Participant
December 25, 2012
Answered

Apache ColdFusion 10 Process .HTML Files Containing CFML

  • December 25, 2012
  • 1 reply
  • 4923 views

I am on Mac Mountain Lion, but that shouldn't make a difference.

This is for a clients website, so I need to get this working ASAP.

Any advice on how to get CF 10 working with this setup, only serving .html files that contain CFML?


So far I have tried:

1. Adding /*.html = cfusion and /*.htm = cfusion to my uriworkermap_cfusion.properties file.


2. Adding .htm and .html to the AddHandler jakarta-servlet .cfm .cfml .cfc .cfr .cfswf line in my apache conf file.


.cfm files and CF Admin render correctly, but when I call a .html file that contains CFML I get a Tomcat error saying the requested resource is not available.

Thanks for any advice on this, I am out of ideas.

I've had no trouble getting this to work on Windows, IIS and CF10.

This topic has been closed for replies.
Correct answer BKBK

I am on a different system, but my guess is that:

1) the properties file should contain the lines

/*.cfm = cfusion

/*.html = cfusion

/*.htm = cfusion

2) you should save the file as uriworkermap.properties;

3) The intention now is to edit system file /WEB-INF/web.xml, by adding html and htm mappings to it. First and foremost, back-up the file, just in case. 

Open the web.xml file in a text editor. Locate the elements whose IDs are of the form "coldfusion_mapping_x", where x is a number in the set {0,1,2,...}. Locate the highest such number. Let's call it X. The ID of a new ColdFusion mapping will therefore begin with X+1.

Now, edit the web.xml file by adding the following 2 new mappings immediately after mapping number X (replacing X with the actual value!):

<servlet-mapping id="coldfusion_mapping_X+1">

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

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

</servlet-mapping>

<servlet-mapping id="coldfusion_mapping_X+2">

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

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

</servlet-mapping>

To illustrate, on my system the highest number in the IDs of the form "coldfusion_mapping_x" is 15. So, for me, X is 15. Therefore, if I followed the above instructions, I would have to add the following 2 mappings immediately after mapping number 15:

<servlet-mapping id="coldfusion_mapping_16">

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

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

</servlet-mapping>

<servlet-mapping id="coldfusion_mapping_17">

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

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

</servlet-mapping>

Save the edited web.xml file.

4) Restart ColdFusion.

1 reply

BKBK
Community Expert
BKBKCommunity ExpertCorrect answer
Community Expert
December 26, 2012

I am on a different system, but my guess is that:

1) the properties file should contain the lines

/*.cfm = cfusion

/*.html = cfusion

/*.htm = cfusion

2) you should save the file as uriworkermap.properties;

3) The intention now is to edit system file /WEB-INF/web.xml, by adding html and htm mappings to it. First and foremost, back-up the file, just in case. 

Open the web.xml file in a text editor. Locate the elements whose IDs are of the form "coldfusion_mapping_x", where x is a number in the set {0,1,2,...}. Locate the highest such number. Let's call it X. The ID of a new ColdFusion mapping will therefore begin with X+1.

Now, edit the web.xml file by adding the following 2 new mappings immediately after mapping number X (replacing X with the actual value!):

<servlet-mapping id="coldfusion_mapping_X+1">

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

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

</servlet-mapping>

<servlet-mapping id="coldfusion_mapping_X+2">

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

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

</servlet-mapping>

To illustrate, on my system the highest number in the IDs of the form "coldfusion_mapping_x" is 15. So, for me, X is 15. Therefore, if I followed the above instructions, I would have to add the following 2 mappings immediately after mapping number 15:

<servlet-mapping id="coldfusion_mapping_16">

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

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

</servlet-mapping>

<servlet-mapping id="coldfusion_mapping_17">

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

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

</servlet-mapping>

Save the edited web.xml file.

4) Restart ColdFusion.

MIsterS33Author
Participant
December 26, 2012

BKBK,

Thanks for the help, but in my original post I mentioned that I had already tried steps 1 and 2 of your post ( adding the entries to the properties file ).

Are you on ColdFusion 10? I have CF10 installed on three different machines and none of them have servlet mappings for ColdFusion in the web.xml file. I have seen these mappings in all JRun versions of CF, but not CF10.

BKBK
Community Expert
Community Expert
December 26, 2012

MIsterS33 wrote:

Thanks for the help, but in my original post I mentioned that I had already tried steps 1 and 2 of your post ( adding the entries to the properties file ).

OK. The idea was just to confirm.

Are you on ColdFusion 10? I have CF10 installed on three different machines and none of them have servlet mappings for ColdFusion in the web.xml file. I have seen these mappings in all JRun versions of CF, but not CF10.

I am on ColdFusion 10 and Windows 7 Ultimate. the location of my web.xml file is C:\ColdFusion10\cfusion\wwwroot\WEB-INF\web.xml.