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 Leonardo <mi...@ifactory.com> on 2009/12/07 07:08:07 UTC

Access the Tapestry IoC from another servlet

Hello!

I'm writing an application that has both a T5 web app and also a Restlet servlet in the same project. So T5 is the servlet-filter and the Restlet is an actual servlet. To allow both to co-exist I've configured the T5 AppModule to ignore anything with /rest/ at the beginning of the request - and that all works fine.

The issue is that I would really like to use the Tapestry IoC from the web app in my Restlet servlets. Is there anyway to do this? I tried following the instructions for non-web registry creation (added the code to the restlet initialization) and got the message:

"[ERROR] internal.SerializationSupport Setting a new service proxy provider when there's already an existing provider.  may indicate that you have multiple IoC Registries."

So I think the Restlet actually sees the registry from the web app running. Is that true - and if so can I get access to it?

Sorry, I'm a bit new to all this configuration.
Thanks for any help!

Michael Leonardo
- iFactory Software Engineer

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


Re: Access the Tapestry IoC from another servlet

Posted by DH <ni...@gmail.com>.
ServletContext context = FilterConfig.getServletContext();
context.getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME);

See TapestryFilter, hope that helps.

DH
http://www.gaonline.com.cn

----- Original Message ----- 
From: "Mike Leonardo" 
To: <us...@tapestry.apache.org>
Sent: Monday, December 07, 2009 2:08 PM
Subject: Access the Tapestry IoC from another servlet


> Hello!
> 
> I'm writing an application that has both a T5 web app and also a Restlet servlet in the same project. So T5 is the servlet-filter and the Restlet is an actual servlet. To allow both to co-exist I've configured the T5 AppModule to ignore anything with /rest/ at the beginning of the request - and that all works fine.
> 
> The issue is that I would really like to use the Tapestry IoC from the web app in my Restlet servlets. Is there anyway to do this? I tried following the instructions for non-web registry creation (added the code to the restlet initialization) and got the message:
> 
> "[ERROR] internal.SerializationSupport Setting a new service proxy provider when there's already an existing provider.  may indicate that you have multiple IoC Registries."
> 
> So I think the Restlet actually sees the registry from the web app running. Is that true - and if so can I get access to it?
> 
> Sorry, I'm a bit new to all this configuration.
> Thanks for any help!
> 
> Michael Leonardo
> - iFactory Software Engineer
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>