我有一個ColdFusion網站與application.cfm。它在它定義的cfapplication:你可以在application.cfm中有多個cfapplications?
<cfapplication name="FhaApp" clientmanagement="no"
sessionmanagement="yes" sessiontimeout="#createTimeSpan(0,0,360,0)#">
<cflock timeout="120" name="#session.sessionID#" type="exclusive">
<cfcookie name="CFID" value="#session.CFID#" >
<cfcookie name="CFTOKEN" value="#session.cftoken#" >
</cflock>
<cfparam name="session.fromwhere" default="">
<cfif #cgi.SCRIPT_NAME# contains 'default-partner-'>
<cfif not ISDEFINED("cookie.fromwhere")>
<cfcookie name="fromwhere" value="#right(cgi.SCRIPT_NAME, (len(cgi.SCRIPT_NAME)-1))#" expires="30">
<cfset session.fromwhere = #right(cgi.SCRIPT_NAME,(len(cgi.SCRIPT_NAME)-1))#>
</cfif>
</cfif>
<cfset datasourcename="fha47">
<cfparam name="application.dsn" default="fha47">
<cfparam name="session.loggedin" default="false">
<cfparam name="session.ppcid" default="101">
<cfparam name="session.cid" default="FHA">
我想補充另一個cfapplication,看起來像這樣:
<cfapplication name = "QSvalues"
sessionTimeout = "#CreateTimeSpan(0,0, 0, 60)#"
sessionManagement = "yes">
<cflock scope = "Session"
timeout = "30" type = "Exclusive">
<cfif NOT IsDefined("session.prop_st")>
<cfset session.prop_st = "">
</cfif>
<cfif NOT IsDefined("session.prop_zip")>
<cfset session.prop_zip = "">
</cfif>
<cfif NOT IsDefined("session.address")>
<cfset session.address = "">
</cfif>
<cfif NOT IsDefined("session.email")>
<cfset session.email = "">
</cfif>
<cfif NOT IsDefined("session.fname")>
<cfset session.fname = "">
</cfif>
<cfif NOT IsDefined("session.lname")>
<cfset session.lname = "">
</cfif>
<cfif NOT IsDefined("session.pri_phone_1")>
<cfset session.pri_phone_1 = "">
</cfif>
<cfif NOT IsDefined("session.pri_phone_2")>
<cfset session.pri_phone_2 = "">
</cfif>
<cfif NOT IsDefined("session.pri_phone_3")>
<cfset session.pri_phone_3 = "">
</cfif>
</cflock>
<cflock scope = "Application" timeout = "30" type = "Exclusive">
<cfif NOT IsDefined("application.number")>
<cfset application.number = 0>
</cfif>
</cflock>
我的問題是,你可以在主application.cfm定義兩個單獨的cfapplication?
不是。它可能不會導致語法錯誤,但最後一個會勝出。你想達到什麼目的? – Leigh 2012-02-06 19:46:52