Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-18 Thread Igor Vaynberg
salve is available in the maven repo. the link is on the front page of the project. you shouldnt be compiling it yourself. -igor On Tue, Aug 18, 2009 at 6:30 AM, Haulyn R. Jason wrote: > Hi, all: > The process of compiling salve is passed, and I tried to setup it and > testing. But, how can I get

Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-18 Thread Igor Vaynberg
it depends on how you initialize guice. if you are using a servlet context listener then that creates the injector and sticks it into servlet context where you can get it. if you are creating the injector yourself then you have a reference to it. -igor On Tue, Aug 18, 2009 at 7:12 AM, Haulyn R.

Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-18 Thread Haulyn R. Jason
Hi, all: The process of compiling salve is passed, and I tried to setup it and testing. But, how can I get guice injector from wicket? I use the code below in my wicket Application's init function, DependencyLibrary.addLocator(new GuiceBeanLocator(injector)); but how can I get the guice injector?

Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-18 Thread Haulyn R. Jason
Hi, Igor, Thanks for your reply, I tried salve but when I compile it, there are some testing failures. Can you help me to find a binary download link? Or any other solutions are also great! I need to make salve run with wicket and guice. Thanks. On Tue, Aug 18, 2009 at 1:34 AM, Igor Vaynberg wrot

Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-17 Thread Igor Vaynberg
the easiest thing is to inject your component and pass the reference into your model. outside that there is salve.googlecode.com that lets you inject any object. InjectorHolder.getInjector() doesnt work with guice because it is possible to have more then one injector - one per module. -igor On

Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-17 Thread Haulyn R. Jason
Hi, I got these blow: java.lang.IllegalStateException: InjectorHolder has not been assigned an injector. Use InjectorHolder.setInjector() to assign an injector. In most cases this should be done once inside SpringWebApplication subclass's init() method. I didn't use spring. I use wicket with guic

Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-17 Thread Haulyn R. Jason
I try to add this line, but it doesn't work. I try to test a simple service binding in guice module, it works well with : @Inject ITestService testService; Thanks. On Tue, Aug 18, 2009 at 12:01 AM, Arie Fishler wrote: > in the ctor just add this line > > InjectorHolder.*getInjector*().inject

Re: How to use Guice to inject Service to LoadableDetachableModel

2009-08-17 Thread Arie Fishler
in the ctor just add this line InjectorHolder.*getInjector*().inject(*this*); On Mon, Aug 17, 2009 at 6:26 PM, Haulyn R. Jason wrote: > Hi, all: > I have a class which is likes below: > > > public class DetachableMemberModel extends LoadableDetachableModel > { > >private final long id; > >

How to use Guice to inject Service to LoadableDetachableModel

2009-08-17 Thread Haulyn R. Jason
Hi, all: I have a class which is likes below: public class DetachableMemberModel extends LoadableDetachableModel { private final long id; public DetachableMemberModel(Member m) { this(m.getId()); } public DetachableMemberModel(long id) { if (id == 0) {