You need a contstructor that does the injecting:

public GlobalNewsListModel() {
    InjectorHolder.getInjector().inject(this);
}


On 10/3/06, Leszek Gawron < [EMAIL PROTECTED]> 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



--
Caleb Land
( [EMAIL PROTECTED])
-------------------------------------------------------------------------
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

Reply via email to