In Application.cfc I am trying to check security at the beginning of
the request:
<cffunction name="setupRequest">
<cfset request.context.startTime = getTickCount()>
<cfinvoke component="controllers.security" method="authorize">
</cffunction>
Here is my security.cfc:
<cfcomponent>
<cfscript>
function init( fw ) {
variables.fw = fw;
}
function session(rc) {
// set up the user's session
session.auth = {};
session.auth.isLoggedIn = false;
session.auth.fullname = 'Guest';
}
function authorize(rc) {
// check to make sure the user is logged on
if ( not session.auth.isLoggedIn and
not listfindnocase( 'login', variables.fw.getSection() ) and
not listfindnocase( 'main.error',
variables.fw.getFullyQualifiedAction() ) ) {
variables.fw.redirect('default');
}
}
</cfscript>
</cfcomponent>
(Straight from somefw/1 sample code)
When I try to browse to
http://localhost/admin/default I get the
following error:
An error occurred!
Action: admin.default
Error: Element FW is undefined in a Java object of type class
[Ljava.lang.String;.
Type: Expression
Details:
Here is my admin.cfc:
<cfcomponent>
<cfscript>
function init(fw) {
variables.fw = fw;
}
</cfscript>
<cffunction name="default" access="public">
<cfscript>
variables.fw.service("admin.default", "data");
</cfscript>
</cffunction>
</cfcomponent>
Any help would be appreciated.