Try:

@Inject
@Service("MyService1") private IMyInterface  _CMF;


Check the end of this page
http://tapestry.apache.org/tapestry5/tapestry-core/guide/inject.html

maxthesecond wrote:
> Thanks a lot
> but now I get the following compiler error: The anotation @InjectService is
> disallowed for this location.
> ??
>
> BTW the location is on a regular page class:
>
> public class TestProductDivContainer {
>       @Inject private Logger _logger;
>       
>       @ApplicationState(create=true)
>       private CMSession _CMSession;
>        
>       @InjectService("MyService1") private IMyInterface  _CMF;
>
> }
>       
> Before I have @Inject private IMyInterface _CMF;
>
>
>
>
> Kheldar666 wrote:
>   
>> @InjectService("MyService1")
>>
>>
>> maxthesecond wrote:
>>     
>>>
>>> I have an Interface with 2 different implementations
>>>
>>> lets say  IMyInterface   MyImplementation1  Myimplementation2
>>>
>>>
>>> until now I only needed to use one of the implementations at once, so in
>>> my client code I just wrote @Inject private IMyInterface
>>>
>>>
>>> and everithing was ok, now I'm on the need to use at the same time both
>>> implementations 
>>>
>>> My first idea was to write: 
>>>
>>> binder.bind(IMyInterface.class,MyImplementation1.class).withId("Myservice1");
>>> binder.bind(IMyInterface.class,MyImplementation2.class).withId("MyService2");
>>>
>>> But now the question is: How I am suposed to used it from the client
>>> side( I mean a page a component)?
>>>
>>> @Inject MyService1?
>>>
>>> thanks for the answer!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>       
>>     
>
>   

Reply via email to