You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Huergo Perez <hu...@gmail.com> on 2007/08/28 15:08:55 UTC

Propagating user context to the business layer

Hi All,

I have a user context stored in a Wicket session with all required user 
information (username, roles, etc. -- put in the session upon user log 
in). I need to make the user context available to my business layer via 
a thread-local variable. That is, I need to put it in a thread-local 
variable in the very beginning of the request, and clean it up just 
before the request has finished.

In a pure servlet environment I would do that in a filter. In Spring MVC 
I would do that in a handler interceptor.

What is the best way to do that in Wicket?

Thanks in advance!
Huergo



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Propagating user context to the business layer

Posted by Matej Knopp <ma...@gmail.com>.
You can extend RequestCycle and do that in onEndRequest. To use custom
request cycle class override Application.newRequestCycle(final Request
request, final Response response);

-Matej

On 8/28/07, Huergo Perez <hu...@gmail.com> wrote:
>
> Hi All,
>
> I have a user context stored in a Wicket session with all required user
> information (username, roles, etc. -- put in the session upon user log
> in). I need to make the user context available to my business layer via
> a thread-local variable. That is, I need to put it in a thread-local
> variable in the very beginning of the request, and clean it up just
> before the request has finished.
>
> In a pure servlet environment I would do that in a filter. In Spring MVC
> I would do that in a handler interceptor.
>
> What is the best way to do that in Wicket?
>
> Thanks in advance!
> Huergo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>