you missed this: public SomeModel() { InjectorHolder.getInjector().inject(this); }
-Igor Leszek Gawron-2 wrote: > > Joni Freeman wrote: >> Yes, it works. I use it in many places. >> >> Joni > I have just checked: > >> public class GlobalNewsListModel extends LoadableDetachableModel { >> @SpringBean >> private NewsService newsService; >> >> public NewsService getNewsService() { >> return newsService; >> } >> >> @SuppressWarnings("unchecked") >> @Override >> protected Object load() { >> return new LinkedList( getNewsService().getGlobalNews( >> Session.get().getLocale().getLanguage(), >> 10 ) ); >> } >> } > > > throws NPE. Not much space for eror, is it? The only thing I can think > of is that you are using nested classes or anonymous classes (which you > should not do for models - so I've read). > > > -- > Leszek Gawron > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/-tutorial--Wicket-%2B-Spring-integration---revisited-tf2375652.html#a6622516 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user