File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting hibernate session in Struts2 (Urgent)" Watch "getting hibernate session in Struts2 (Urgent)" New topic
Author

getting hibernate session in Struts2 (Urgent)

sam raghav
Greenhorn

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
Author
Rancher

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getting hibernate session in Struts2 (Urgent)
 
Similar Threads
downloading a file struts2
struts2
Struts2 + Hibernate
Struts2 hibernate one-to-one Mapping
Struts2