• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting hibernate session in Struts2 (Urgent)

 
sam raghav
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am new to Struts2, I am generating hibernate sessionFactory and hibernate Session implementing Filter.

Now DAO needs hibernate session object to access database. But I don't know how to get it?

Please help.

Thanks and regards.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See EaseUp.

This isn't really a Struts-related question if you're just asking how to get Hibernate sessions/session factories. There are several ways to go about it; the ORM forum might be a more appropriate place to ask.

If you're using Spring then the DAOs can be injected with session factories essentially automatically.
 
Always look on the bright side of life. At least this ad is really tiny:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!