Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

struts/hibernate/tomcat question

Rick Schumeyer

2007-01-02

Replies:

The examples I have seen (in S1) for using hibernate with struts involve
using a plugin which creates a hibernate sessionFactory and stores it in
session context.
Each Action then retrieves the sessionFactory from the session and
passes it to a model bean.

It is my understanding that if I were using a real J2EE container (which
I am not doing, nor am I going to do) I could use JNDI to store the
session factory and then retrieve it from within a model bean.

But I'm only using a servlet container (tomcat) so is my current
strategy the only option? I would prefer if the model beans did not
rely on the Actions to forward a sessionFactory, but I'm not sure if
there is a way around it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.