Tips: Controllers

2 views
Skip to first unread message

DavidNia

unread,
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.

david

Reply all
Reply to author
Forward
0 new messages