haven't use this plug before. but I think Spring-plug-in, would be better! It's less config!
On Wed, Oct 15, 2008 at 11:04 AM, Anoop <[EMAIL PROTECTED]> wrote: > Hi, > We are looking forward to integrating struts with hibernate in our web > application project. Could you guide us on how to to integrate them. I > tried the hibernate plugin as recommended on the hibernate website, > however that throws a null pointer exception(when i try to instantiate > a session) when i test it in tomcat. > > Relevant piece of code > in struts-config.xml > <plug-in > > className="de.laliluna.hibernate.plugin.HibernatePlugIn"> > <set-property > property="configFilePath" > value="/hibernate.cfg.xml" /> > <set-property > property="storeInServletContext" > value="true" /> > > In struts action > try{ServletContext context = request.getSession().getServletContext(); > SessionFactory _factory = (SessionFactory) > > context.getAttribute(HibernatePlugIn.SESSION_FACTORY_KEY); > Session ses = _factory.openSession(); <---this line > throws exception > -- > Anoop Dhanvijay > DA-IICT > > "Most of man's failures were when they didn't realize how close they > were to success, when they finally gave up!" > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- BestRegards, Mead http://yayisoft.com Helen Hayes - "Age is not important unless you're a cheese."