Tips: Controllers

Skip to first unread message


Jan 6, 2010, 5:06:14 PM1/6/10
to Induction Framework
init() is a reserved method for Controllers in Induction. It is
treated differently than other functions. Example, a non-init
function in a Controller can have the regular Induction models
injected into it...but the init() method can only get the stuff that
is regularly valid to be injected into the constructor...if i am not
mistaken it is only application-scope models.

I found out about this when in my code I wrote:

return new Redirect( TestController.class, "init" );

and to my surprise a session-scope model that I had injected was null.
I renamed init to something else and it worked.


Reply all
Reply to author
0 new messages