I am trying to use Hibernate with Struts. Will it be a good pratice if I extend the FilterDispacther for calling Hibernate Utility classes?
Anyone have any views? I want to discuss the pros and cons with this approach.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Don’t extend
FilterDispatcher.As duffymo indicated, if you need to set up and tear down a Hibernate session for the current request, you should use an interceptor. You can use the
OpenSessionInViewInterceptorthat he linked too, or if you don’t use Spring, you can create your own.