aspose file tools*
The moose likes Struts and the fly likes Integrating Struts 2 with Hibernate. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Integrating Struts 2 with Hibernate. " Watch "Integrating Struts 2 with Hibernate. " New topic
Author

Integrating Struts 2 with Hibernate.

Siddharth Bhargava
Ranch Hand

Joined: Feb 23, 2007
Posts: 248
I want to use Hibernate with Struts 2 for persistence. Does Struts 2 has ORM framework support like Spring framework OR do we have to write our own Hibernate code in Struts 2 action classes. I have searched the net for articles(http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html) but couldn't find a good article which explains how to integrate struts 2 with Hibernate. Please Help as i am unable to fins a solution. Thanks in advance.

Amit Y Desai
Ranch Hand

Joined: Dec 06, 2007
Posts: 35
no there is no framework in struts for ORM...you have to write hibernate layer and intergrate with struts 2...


A good approach is design integration tier to hand abstraction for hibernate layer...entier hibernate code should be encapsulated using DAO approach..

I had been working on application that has same configurations.incase of further issue let me know.
Siddharth Bhargava
Ranch Hand

Joined: Feb 23, 2007
Posts: 248
I tried Hibernate integration with struts 2. I wrote the code for hibernate. The problem is that my form data is not being populated with values.
The values are coming null.

struts.xml



Register.jsp



Register.java

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integrating Struts 2 with Hibernate.
 
Similar Threads
Problem with @Transactional (Transaction is not getting rollbacked)
MVC for spring+hibernate projects
Which Framework Combination do you use?
need Suggestion
questions for c++ without fear