You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tim <ko...@gmail.com> on 2011/11/09 20:43:08 UTC
How to get a SessionState object in AppModule.contributeTypeCoercer
?
I'm contributing a type coercer for one of my classes called
SearchCriteria in my AppModule.contributeTypeCoercer method.
SearchCriteria is a class that holds search information for when someone
does a search on the website, and I'm passing it around with onActivate
and onPassivate. It is the activation context. That part works well.
However, to personalize the search, I really need more of the user's
details, which I keep in a SessionState object conveniently called
UserDetails. It would be really handy for me to get the UserDetails
session state inside the AppModule.contributeTypeCoercer method, so I
can give it to SearchCriteria when it is created there.
I hope that makes sense. Anyone have a nifty line of code that can let
me do this?
Thanks a lot.
--
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to get a SessionState object in
AppModule.contributeTypeCoercer ?
Posted by trsvax <tr...@gmail.com>.
Get the ApplicationStateManager in the appmodule method call and from there
you can get any session state.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-get-a-SessionState-object-in-AppModule-contributeTypeCoercer-tp4978877p4978897.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to get a SessionState object in AppModule.contributeTypeCoercer
?
Posted by Igor Drobiazko <ig...@gmail.com>.
Just inject ApplicationStateManager into the contribution method. The
service provides access to SSOs. Note that injecting into TypeCoercer's
contribute method is special; you need to use @InjectService annotation.
On Wed, Nov 9, 2011 at 8:43 PM, Tim <ko...@gmail.com> wrote:
> I'm contributing a type coercer for one of my classes called
> SearchCriteria in my AppModule.**contributeTypeCoercer method.
> SearchCriteria is a class that holds search information for when someone
> does a search on the website, and I'm passing it around with onActivate and
> onPassivate. It is the activation context. That part works well.
>
> However, to personalize the search, I really need more of the user's
> details, which I keep in a SessionState object conveniently called
> UserDetails. It would be really handy for me to get the UserDetails
> session state inside the AppModule.**contributeTypeCoercer method, so I
> can give it to SearchCriteria when it is created there.
>
> I hope that makes sense. Anyone have a nifty line of code that can let me
> do this?
>
> Thanks a lot.
>
> --
> Tim
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Best regards,
Igor Drobiazko
http://tapestry5.de