Is there any way i can get a servlet context in existing Restlet 2 m4 build.
Thanks,
Rahul


On Sun, Sep 13, 2009 at 2:09 PM, Rhett Sutphin <[email protected]>wrote:

> Hi Rahul,
>
> There's a known bug with SpringFinder in 2.0M4.  It will hopefully be
> fixed in the next milestone.
>
> http://restlet.tigris.org/issues/show_bug.cgi?id=892
>
> Rhett
>
> On Sep 12, 2009, at 5:42 PM, Rahul Juneja wrote:
>
> > Here is my scenario. I am trying to inject some service in my
> > ServerResource class and its just not injecting the service.
> >
> > The steps I have performed are as follows.
> >
> >       <util:map id="resourceMap">
> >               <entry key="/request">
> >                       <bean id="configurationFinder"
> > class="org.restlet.ext.spring.SpringFinder">
> >                               <lookup-method name="createResource"
> bean="requestResouce"/>
> >                       </bean>
> >               </entry>
> >       </util:map>
> >
> >       <bean id="requestResouce" class="com.thoughtclicks.requestResource"
> > scope="prototype">
> >               <property name="service" ref="serviceBean" />
> >       </bean>
> >
> > Where serviceBean is already defined in the config file. also
> > Resource class is a simple Class extending ServerResource and having
> > a property called "service" with a public getter and setter of the
> > property.
> >
> > My application class is simple extending the Application class from
> > org.restlet.Application with the following code :
> >
> > @Override
> >               public Restlet createRoot() {
> >                       Router router = new Router(getContext());
> >
> >                       SpringContext springContext = new
> SpringContext(getContext());
> >                       XmlBeanDefinitionReader xmlReader = new
> XmlBeanDefinitionReader
> > (springContext);
> >                       xmlReader.loadBeanDefinitions(new
> ClassPathResource("resource/
> > appContext.xml"));
> >                       springContext.refresh();
> >                       Map<String, Finder> resourceMap = (Map<String,
> Finder>)
> > springContext.getBean("resourceMap");
> >                       for (String key : resourceMap.keySet())
> >                       {
> >                               router.attach(key, resourceMap.get(key));
> >                   }
> >                       return router;
> >
> >               }
> >
> > Not sure what is wrong as my service is returning null for some
> > reason and when i see the logs i don;t see my injection methods
> > being called.
> >
> > Any clues or pointers to this is highly appreciated.
> >
> > Thanks,
> > Rahul
> >
> >
> >
> >
> >
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2394329
>



-- 
Rahul Juneja
Phone : (631) 681-9996
Fax :  (206) 339-9047
http://techlabs.thoughtclicks.com
http://finance.thoughtclicks.com
---------------------------------------------------------------------------
The thing always happens that you really believe in;
and the belief in a thing makes it happen.

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

Reply via email to