FW/1 and redirect in the application.cfc

Chatting with AJ Mercer this morning (his evening) on getting redirect() to work in the Application.cfc for Framework One (FW/1). The code being he was using looked perfectly fine:

rc.variableToPass = "me";redirect(variables.framework.home, 'all', 'variableToPass');

As I said this looked fine and works in the controllers but in the Application.cfc we just saw "&fw1pk=[some number]" appended to the URL. The fix was quite simple. The variable/structure RC is set as a shortcut to the Request.Context for the controllers but in the Application.cfc you need to reference Request.Context directly. The meant the above code changed to:

request.context.variableToPass = "me";redirect(variables.framework.home, 'all', 'variableToPass');

and all worked fine.

As a side note the fix for this came from it being such a simple framework to hack in to and see whats happening over others with multiple core files and components. Recently my work ethics has changed a lot and in its place 2 components now stand, convention over configuration and simplicity both of which FW/1 fits the bill. So if you haven't spent 30 minutes looking at it do so and also check out the Google group at http://groups.google.com/group/framework-one


comments powered by Disqus