Hi guy's me again! Finally got around to taking a look at converting my
application.cfm to application.cfc using Ray Camdens example. I thought I had
this working, it looks so simple, but for the life of me I cannot get this to
work. Below is my application.cfc
<cfcomponent output="false">
<cfset this.name = "MyApplicationName">
<cfset this.applicationTimeout = createTimeSpan(0,2,0,0)>
<cfset this.clientManagement = true>
<cfset this.clientStorage = "MyClientStorage">
<cfset this.loginStorage = "session">
<cfset this.sessionManagement = true>
<cfset this.sessionTimeout = createTimeSpan(0,1,0,0)>
<cfset this.setClientCookies = true>
<cfset this.setDomainCookies = false>
<cfset this.scriptProtect = true>
<cffunction name="onApplicationStart" returnType="boolean"
output="false">
<cfreturn true>
</cffunction>
<cffunction name="onApplicationEnd" returnType="void" output="false">
<cfargument name="applicationScope" required="true">
</cffunction>
<cffunction name="onRequestStart" returnType="boolean" output="false">
<cfargument name="thePage" type="string" required="true">
<cfif right(cgi.script_name, Len("index.cfm")) NEQ "index.cfm"
AND right(cgi.script_name, 3) NEQ "cfc">
<cflocation url="index.cfm" addtoken="no">
</cfif>
<cfreturn true>
</cffunction>
<cffunction name="onRequest" returnType="void">
<cfargument name="thePage" type="string" required="true">
<cfinclude template="../#arguments.thePage#">
</cffunction>
<cffunction name="onRequestEnd" returnType="void" output="false">
<cfargument name="thePage" type="string" required="true">
</cffunction>
<cffunction name="onError" returnType="void" output="true">
<cfargument name="exception" required="true">
<cfargument name="eventname" type="string" required="true">
</cffunction>
<cffunction name="onSessionStart" returnType="void" output="false">
</cffunction>
<cffunction name="onSessionEnd" returnType="void" output="false">
<cfargument name="sessionScope" type="struct" required="true">
<cfargument name="appScope" type="struct" required="false">
</cffunction>
</cfcomponent>
That is it, as simple as that. I restarted my coldfusion server and the first
time I ran it there was no page so in the 'OnRequest' I had to prepend '../' to
#arguments.thepage# (I still don't know why?) and then I had my login page
appear. Just to make sure I restarted my server again and now I do not get any
page at, not even an error! In my debug code I see the trace of all pages to be
included but nothing is displayed, what have I screwed up,anyone?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:12:6827
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/12
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:12
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.12
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54