You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mike Snare <mi...@gmail.com> on 2006/05/05 16:33:58 UTC

Access ServletContext in an eagerLoad service

I have an application initialization service (InitService) that I've
contributed to eagerLoad.  I have a need to extract true path
information to set an application property for use by later services
(that should not need to access the servlet context themselves).

To do this, I added a setter to my InitService for a ServletContext. 
In that method, I try to call the getRealPath method.  This fails with
a message from tapestry claiming that:

java.lang.NullPointerException: Property 'servletContext' of
<SingletonProxy for
tapestry.globals.ApplicationGlobals(org.apache.tapestry.services.ApplicationGlobals)>
is null.

It would appear that the ServletContext has not been stored in the
Globals yet, but I need to access it.

Any ideas?

Thanks,
-Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org