OK, but then I'll end up with all classes being services, since basic services 
like logging, configuration, etc. will be used in almost any class. I've found 
no way to circumvent that, since  I've noticed that the @InjectService 
annotation can only be used as a parameter declaration to a method. So I can't 
call that mehod myself anymore from a normal class. 
That would mean that the world of services is isolated against normal POJOs...
Frankly, I think I'll take the normal approach with singletons for the 
"services" used in my business logic.
Thanks anyway.

Udo.


-------- Original-Nachricht --------
> Datum: Thu, 3 Jul 2008 09:53:38 +0200 (CEST)
> Von: "Ulrich Stärk" <[EMAIL PROTECTED]>
> An: "Tapestry users" <users@tapestry.apache.org>
> Betreff: Re: T5 service injection outside pages

> You'll have to declare those classes where you want to use your service as
> services too, i.e. you either have to write a buildXXX method in your
> AppModule or do a binder.bind(). You can then either use the
> @InjectService annotation to inject your service or just write a
> constructor with the desired service as a paramater and Tapestry will do
> the rest for you.
> 
> Uli
> 
> Am Do, 3.07.2008, 09:40, schrieb Udo Abel:
> > Hi,
> >
> > in my app, I have a service which works OK in pages and component
> classes,
> > but of course a lot of business logic is outside of those classes in
> > separate packages, where I need that service, too.
> >
> > But if I simple @Inject it as in page classes, it does not work (i.e. is
> > null).
> >
> > Is the injection limited to pages (maybe because they get transformed on
> > startup)? Or do I need to do something else for injection outside of
> > pages?
> >
> > Thanks,
> > Udo.
> > --
> > Psssst! Schon vom neuen GMX MultiMessenger gehört?
> > Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to