You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andrey Larionov <an...@gmail.com> on 2009/10/14 09:40:29 UTC
SSO objects and Services
Can i inject (via @SessionState) SSO objects into services? I'm try
but value of field always null.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: SSO objects and Services
Posted by Andrey Larionov <an...@gmail.com>.
Thanks. Obivious solution. i should be more attentive.
On Wed, Oct 14, 2009 at 11:53, <di...@bgs-ag.de> wrote:
> Hello Andrey,
>
> Andrey Larionov <an...@gmail.com> schrieb am 14.10.2009 09:40:29:
>
>> Can i inject (via @SessionState) SSO objects into services? I'm try
>> but value of field always null.
>
> @SessionState works only in page and component classes.
>
> You can add the parameter "ApplicationStateManager asm" to the constructor
> of your service.
> Tapestry IOC will then inject the ApplicationStateManager when calling the
> constructor.
> In your constructor, put asm into a (private final) field of your service.
> You can than use asm.get(SsoObject.class) to retrieve the desired SSO
> object by its class. You can also check the existence with
> asm.exists(SsoObject.class), or use asm.getIfExists, or put an object
> asm.set(SsoObject.class, object).
>
> Dirk
> BGS Beratungsgesellschaft
> Software Systemplanung AG Niederlassung Köln/Bonn
> Grantham-Allee 2-8
> 53757 Sankt Augustin
> Fon: +49 (0) 2241 / 166-500
> Fax: +49 (0) 2241 / 166-680
> www.bgs-ag.de Geschäftssitz Mainz
> Registergericht
> Amtsgericht Mainz
> HRB 62 50
> Aufsichtsratsvorsitzender
> Klaus Hellwig
> Vorstand
> Hermann Kiefer
> Nils Manegold
> Thomas Reitz
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Antwort: SSO objects and Services
Posted by di...@bgs-ag.de.
Hello Andrey,
Andrey Larionov <an...@gmail.com> schrieb am 14.10.2009 09:40:29:
> Can i inject (via @SessionState) SSO objects into services? I'm try
> but value of field always null.
@SessionState works only in page and component classes.
You can add the parameter "ApplicationStateManager asm" to the constructor
of your service.
Tapestry IOC will then inject the ApplicationStateManager when calling the
constructor.
In your constructor, put asm into a (private final) field of your service.
You can than use asm.get(SsoObject.class) to retrieve the desired SSO
object by its class. You can also check the existence with
asm.exists(SsoObject.class), or use asm.getIfExists, or put an object
asm.set(SsoObject.class, object).
Dirk
BGS Beratungsgesellschaft
Software Systemplanung AG Niederlassung Köln/Bonn
Grantham-Allee 2-8
53757 Sankt Augustin
Fon: +49 (0) 2241 / 166-500
Fax: +49 (0) 2241 / 166-680
www.bgs-ag.de Geschäftssitz Mainz
Registergericht
Amtsgericht Mainz
HRB 62 50
Aufsichtsratsvorsitzender
Klaus Hellwig
Vorstand
Hermann Kiefer
Nils Manegold
Thomas Reitz