You can also consider rewriting your own ApplicationServlet I mean craete a servlet which extends from tapestry ApplicationServlet. Init method of your servlet will do anything you need and then call tapestry ApplicationServlet.
Renat On 13/07/07, Norman Franke <[EMAIL PROTECTED]> wrote:
I don't have an issue with Hibernate, I just want to use it before Tapestry initializes (since it initializes when first accessed, not on container start up despite load-on-startup, at least with Tomcat.) So, yes, I could initialize HiveMind myself and pass it to Tapestry, if I could find out how to do that. Using HiveMindFilter as Igor suggested seems to work, however. -Norman On Jul 12, 2007, at 5:08 PM, Renat Zubairov wrote: > Hi > > I'm a bit confused, you want to have a "reference to Hivemind service" > _before_ tapestry initalizing Hivemind? It means you want to initalize > hivemind your self and then give it to the tapestry? > May I ask you what is the issues you have with Hibernate that you want > to initialize it before it would be initalized by Honeycomb? > > Renat > > On 12/07/07, Norman Franke <[EMAIL PROTECTED]> wrote: >> My question was how to get a reference to a HiveMind service >> (Hibernate based here) from a non-Tapestry servlet prior to Tapestry >> initializing HiveMind. >> >> -Norman >> >> On Jul 12, 2007, at 12:14 PM, Renat Zubairov wrote: >> >> > Hi >> > >> > In hivemind you don't need (shouldnt) use singletons anymore since >> > they are hindering the unit testing. >> > Since you are using plain configuration (hivemind + tapestry) you >> > actually don't need to do anything at all :) (almost) you just >> need to >> > use hivemind + Tapestry + one of the hibernate integration >> module such >> > as honeycomb or tapernate. >> > >> > I can't say anything about tapernate because we are using >> honeycomb. >> > >> > If you need a session in your page you simply create an abstract >> > getter >> > >> > public abstract Session getSession() >> > >> > and declare that it should be populated with the hibernate session >> > from honeycomb (you can check exmaples in the sample application >> you >> > can easily generate with honeycomb archetype and maven). >> > >> > If you need more examples i can post some code fragments here. >> > >> > Renat >> > >> > P.S. Honeycomb author is actively participating in this mail >> list so I >> > think he would be glad to answer your questions >> > >> > On 12/07/07, Norman Franke <[EMAIL PROTECTED]> wrote: >> >> I've been integrating Tapestry 4.0.x into my existing web >> application >> >> based on JSP and servlets. It's all been going quite well so far. >> >> >> >> I've been using Hibernate for database access in Tapestry, but was >> >> using JDBC in the old servlet code. (Since it was developed pre- >> >> hibernate.) Anyway, I want to start using Hibernate (via >> HiveMind) in >> >> my servlet code. The question is, how do I get a reference to it? >> >> >> >> I can do this via: >> >> >> >> RegistryInfrastructure reg = (RegistryInfrastructure) >> >> ServiceSerializationHelper.getServiceSerializationSupport(); >> >> >> >> And then call getService(MyDesiredDAO.class, null). That seems to >> >> work. When Tomcat starts up, Tapestry doesn't initialize and >> >> getService throws exception stating that HiveMind has not been >> >> configured. >> >> >> >> The question is, how can I force HiveMind to initialize or >> initialize >> >> it myself and not mess up Tapestry? >> >> >> >> Norman Franke >> >> >> >> >> > >> > >> > -- >> > Best regards, >> > Renat Zubairov >> > >> > >> --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > Best regards, > Renat Zubairov > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Best regards, Renat Zubairov --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]