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

Dynamically Generate an Application.cfm

LEGEND ,
Dec 24, 2006 Dec 24, 2006

Copy link to clipboard

Copied

I am attempting to dynamically generate an individual application.cfm for
rescues that are inserted into their custom folder when they sign up. I am
having problems with it. I am getting a java error. Can anyone see what I am
doing wrong and what to fix?

<cfset aName="huskyrescue">

<cfcontent variable="fileApp">
<cfapplication name="#aName#" setclientcookies="yes" sessionmanagement="yes"
loginstorage="Session" applicationtimeout="#createtimespan(1,0,0,0)#"
sessiontimeout="#createtimespan(0,2,0,0)#">
<cfset Request.MyDSN = "MyDSN">
</cfcontent>

<cffile action="write" file="E:/webs/website/#aName#/application.cfm"
output="#fileApp#">


TOPICS
Advanced techniques

Views

347

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
LEGEND ,
Dec 24, 2006 Dec 24, 2006

Copy link to clipboard

Copied

To be exact:

Attribute validation error for tag cfcontent.
"java.lang.String" is not a supported variable type. The variable is
expected to contain binary data.


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
Guest
Dec 24, 2006 Dec 24, 2006

Copy link to clipboard

Copied

i think you want <cfsavecontent> tags, not <cfcontent>.

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
LEGEND ,
Dec 24, 2006 Dec 24, 2006

Copy link to clipboard

Copied

quote:

Originally posted by: [CJ]
i think you want <cfsavecontent> tags, not <cfcontent>.

That was also my initial impression.
NEW
But now that I think about it, I think <cfset> is all you need. You just have to handle the quotes.

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
LEGEND ,
Dec 24, 2006 Dec 24, 2006

Copy link to clipboard

Copied

> i think you want <cfsavecontent> tags, not <cfcontent>.

Indeed.

You also don't want to EXECUTE that code within the <cfsaveconent> tags,
you want to simply output it as text to capture it.

So you're going to want to "escape" the CFML tags.

Possibly the most readable way of doing this is to set a variable thus:

<cfset cf = "<cf">

And replace the "<cf" on the <cfapplication> and <cfset> tags with "#cf#"
(adding a <cfoutput> around the code to ensure it evaluates).

--
Adam

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 24, 2006 Dec 24, 2006

Copy link to clipboard

Copied

LATEST
you could do something like

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