Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OSIV in wicket - legacy servlet application ...

 
Grace Green
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you recommend using a wicket RequestCycleListener to implement the OSIV pattern and storing the hibernate session in a threadlocal ? WOudl there be a way for me to make the hibernate session stored in this ThreadLocal to be available in regular servlets (my app is currently a mix of wicket pages and legacy servlets ? The problem I am encountering is that in the legacy servlets, if I try MyRequestCycleListener.getSession(), the #onEndRequest has already been executed and the session in the ThreadLocal has already been closed.
For the legacy servlets should I use a regular servlet filter ?
Any comments ? tips ?


In MyRequestCycle, I do use the ManagedSessionContext to bind/unbind the hibernate Session:
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic