To help everyone else out since this is undocumented, here is what you
can do instead of using EagerLoader.

Two easy steps:

Step #1: Implement the "ApplicationInitializer" interface in your
service.
Step #2: Add contribution to tapestry.init.ApplicationInitializers

Details:

So, the ApplicationInitializer interace is easy enough:
public void initialize(HttpServlet servlet)
{
        String filePath = 
        
servlet.getServletContext().getRealPath("/WEB-INF/db.xml");     
}

Then in the hivemodule.xml:

<contribution configuration-id="tapestry.init.ApplicationInitializers">
        <command id="MyInitializer" object="service:YourServiceName"/>
</contribution>


-----Original Message-----
From: James Carman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 22, 2006 6:16 PM
To: 'Tapestry users'
Subject: RE: Using EagerLoader and gaining access to
infrastructure:context

What do you need to do with the context?  Can you use an application
initializer?  

-----Original Message-----
From: Curtis Paris [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 22, 2006 7:33 PM
To: Tapestry users
Subject: Using EagerLoader and gaining access to infrastructure:context

I am needing to ues the hivemind.EagerLoader to load a service (database
access layer) early.  It correctly constructs my object.  But, I need
access to the WebContext.  So, simple enough right?  Just inject
infrastructure:context.  I also tried
service:tapestry.globals.WebContext just incase also.  Nope, it's not
available yet.

 

So, how does one use the eager loader, while still having access to the
HTTP Context so that I can ask for files out of WEB-INF?

 

Along the same lines, I removed the EagerLoader for my service.  But,
when the service is referenced by another service point, it is not
properly initialized.  I have a initialize-method on the <construct>
tag, and that initialize method is never invoked.

 

Any help would be appreciated.  Perhaps Tapestry needs it's own
EagerLoader type service that you can ask for things to load after
Tapestry is completed its loading process, and not in line with
HiveMind?

 

Curtis Paris

Sr. Software Engineer

[EMAIL PROTECTED]

650 616 6581 office

 

Shopping.com (tm)

Find. Compare. Buy.

www.shopping.com <blocked::outbind://48/www.shopping.com> 

 




---------------------------------------------------------------------
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]

Reply via email to