I think you're going at this the wrong way, in this particular instance.
I think you'd be better off to do this the way tapestry-hibernate does it. Basically, you instaniate the session the first time it's needed, and then use PerThreadManager to clean up the session at the end of the thread (ie at the end of the request).

Robert

On Nov 25, 2009, at 11/256:42 PM , Alfonso Quiroga wrote:

Answering to myself :)

It is possible to *override* dispatchers... in this case, I did
override "PageRender".
In contributeMasterDispatcher(...) I added :
    configuration.overrideInstance("PageRender", MyDispatcher.class);

where MyDispatcher is the similar to PageRenderDispatcher (default)
but after rendering... I close current hibernate session.
Hope overriding dispatchers is util for someone else. Bye

On Wed, Nov 25, 2009 at 9:05 PM, Alfonso Quiroga <alfonsose...@gmail.com > wrote:
Hi, I made a dispatcher for web-security and it really works fine. As
I'm not using tapestry-hibernate, I want to create a dispatcher for
opening and closing hibernate-sessions.
By now I did it with a RequestFilter and works fine, the problem is
that the RequestFilter filters *everything*, assets, etc.
As I want a filter only for pages, I am thinking in a dispatcher, but
the problem is that in the dispatcher (I think) I can't do post
processing. I need something like
1. openHibernateSession()
2. process page-request
3. close hibernate session

By now I can NOT do it because dispatcher just returns true or false,
and I can't do post processing. Any suggestions? thanks in advance


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to