File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes getting hibernate session in Struts2 (Urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting hibernate session in Struts2 (Urgent)" Watch "getting hibernate session in Struts2 (Urgent)" New topic

getting hibernate session in Struts2 (Urgent)

sam raghav

Joined: Jul 10, 2009
Posts: 10
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

Joined: Sep 29, 2008
Posts: 12617

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.
I agree. Here's the link:
subject: getting hibernate session in Struts2 (Urgent)
It's not a secret anymore!