• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Apache ColdFusion 10 Process .HTML Files Containing CFML

New Here ,
Dec 25, 2012 Dec 25, 2012

Copy link to clipboard

Copied

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.

Views

4.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 26, 2012 Dec 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

...

Votes

Translate

Translate
Community Expert ,
Dec 26, 2012 Dec 26, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 26, 2012 Dec 26, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2012 Dec 26, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 26, 2012 Dec 26, 2012

Copy link to clipboard

Copied

Wow, I feel like an idiot.  There are two web.xml files and the one I was looking at is the ColdFusion10\cfusion\runtime\conf\web.xml.


After I put those servlet mappings in there it started working. Thanks for you're help. I figured it was something staring me right in the face, but I had been trying to get it working for a couple of days now.

Thanks again.

For anyone else that is reading, the fix was to do step 3 of BKBK's post above, but in the web.xml file located in the wwwroot\WEB-INF folder.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2012 Dec 26, 2012

Copy link to clipboard

Copied

LATEST

MIsterS33 wrote:

There are two web.xml files and the one I was looking at is the ColdFusion10\cfusion\runtime\conf\web.xml.


After I put those servlet mappings in there it started working. Thanks for you're help. I figured it was something staring me right in the face, but I had been trying to get it working for a couple of days now.

Thanks again.

For anyone else that is reading, the fix was to do step 3 of BKBK's post above, but in the web.xml file located in the wwwroot\WEB-INF folder.

Please kindly mark this as the answer. It will surely help someone else in future.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation