我有onRequestStart()如下
<cffunction name="onRequestStart" access="public" returntype="boolean" output="false" hint="initializes the request">
<cfif deployment.DBFlag eq 'Live' >
<cfset REQUEST.DataSource = deployment.LiveDSN>
<cfelse>
<cfset REQUEST.DataSource = deployment.TestDSN>
</cfif>
<cfset REQUEST.ServerBasePath = deployment.ServerBasePath>
<cfif not listContains(APPLICATION.ListOfFile,Trim(cgi.script_name))>
<cfif not isDefined("SESSION.UID")>
<cflogout>
<cflocation url="/rpnet-ROI/loginform.cfm" addtoken="no">
</cfif>
</cfif>
<!--- Return true so the page can process. --->
<cfreturn true />
</cffunction>
Run Code Online (Sandbox Code Playgroud)
一旦未定义会话ID,我需要重新加载我的页面.是否可以在Application.cfc中包含javascript?如果是,我们怎么做呢?我们需要包含一个包含javascript代码的cfm文件.
我需要包含在JavaScript中的代码是:
<script>parent.location.reload(true);</script>
Run Code Online (Sandbox Code Playgroud)