Hi Dustin,

Another option you could consider (if you haven't already) is using  
RestletFrameworkServlet and SpringBeanRouter to configure your  
application.  This allows you to use IoC to configure your Resource  
instances, obviating the need to access the ApplicationContext  
directly most of the time.  (If you do still need to access the  
ApplicationContext directly, you can always have the Resource that  
needs it implement ApplicationContextAware.)

Rhett

On Apr 3, 2009, at 9:35 AM, Dustin N. Jenkins wrote:

> Thanks very much Jerome!
>
> We do have other Servlet applications that are outside my control
> unfortunately.
>
> Dustin
>
> Jerome Louvel wrote:
>> Hi Dustin,
>>
>> After looking at the code, there has been changes related to  
>> context in 1.2,
>> to better isolate Components from Applications that affect you.
>>
>> I suggest that you enter an issue report in our tracker so we can  
>> have a
>> closer look at this an see how we could support that again.
>>
>> Alternatively, you could initialize Spring from within Restlet  
>> itself to
>> bypass this issue, unless you have other pure Servlet applications.
>>
>> Best regards,
>> Jerome Louvel
>> --
>> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
>> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>>
>>
>> -----Message d'origine-----
>> De : Dustin N. Jenkins [mailto:dustin.jenk...@nrc-cnrc.gc.ca]
>> Envoyé : mercredi 1 avril 2009 21:45
>> À : discuss@restlet.tigris.org
>> Objet : Loading Spring Beans
>>
>> Hello!
>>
>> I'm using JDK 1.6 with Tomcat 6.0 on Fedora Core 8.
>>
>> I'm upgrading to Restlet 1.2, and I used to create a BeanUtil class  
>> that
>> would load my Spring 1.2.9 beans by casting getContext() to a
>> ServletContextAdapter, then obtaining the ServletContext from there  
>> to use
>> the WebApplicationContextUtils class in Spring to obtain a bean by  
>> name.
>> I'm only loading my Services and DAOs from Spring.
>>
>> In Restlet 1.2, I can no longer cast it.  Is there an easier way to  
>> obtain
>> the ServletContext, or, better yet, to load beans using the Spring
>> extension?
>>
>> Thanks!
>> Dustin
>>
>
> -- 
>
>
> Dustin N. Jenkins | Tel/Tél: 250.363.3101 | dustin.jenk...@nrc-cnrc.gc.ca
>
> facsimile/télécopieur: (250) 363-0045
>
> National Research Council Canada | 5071 West Saanich Rd, Victoria BC.
> V9E 2E7
>
> Conseil national de recherches Canada | 5071, ch. West Saanich,  
> Victoria
> (C.-B) V9E 2E7
>
> Government of Canada | Gouvernement du Canada
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1532829

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1533176

Reply via email to