How can I configure 开发者_运维技巧Hibernate in Struts?
There's a good JavaWorld article on this topic called Struts Recipes: Hibernate and Struts. I suggest you start there.
If you're really smart neither one will know anything about the other.
Hibernate is purely about persistence. It ought to be hidden from Struts behind an interface.
Struts is purely about view. Your Action classes ought to have references to those persistence interfaces and deal with those. It shouldn't know anything about how the interfaces are implemented.
This approach will decouple the two, making your testing job easier. You can write the persistence tier, test it thoroughly, and put it aside.
精彩评论