Hi Ben,
We should fix that for 2.0 RC. Ive updated this related RFE: Allow transmission of parameters from web.xml to applications http://restlet.tigris.org/issues/show_bug.cgi?id=602 Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ <http://www.restlet.org/> http://www.restlet.org Noelios Technologies ~ Co-founder ~ <http://www.noelios.com/> http://www.noelios.com De : Ben Tomasini [mailto:[email protected]] Envoyé : jeudi 3 décembre 2009 04:46 À : [email protected] Objet : Re: Obtaining ServletContext in 2.0-M5 I tried that, but the map of attributes for the context was empty. I had to obtain the context getServerDispatcher().getContext() in order to get a populated attribute map. Ben On Wed, Dec 2, 2009 at 10:15 AM, Ben R Vesco <[email protected]> wrote: I'm also interested to know if there's a better way, but you can also shorten that a bit to: ServletContext sc = (ServletContext) getContext().getAttributes().get("org.restlet.ext.servlet.ServletContext"); On Wed, Dec 2, 2009 at 8:57 AM, BenT <[email protected]> wrote: > In restlet 2.0-M5, from a ServerResource attached to a router used as the > root of a SpringComponent and served from a SpringServerServlet, I had to do > the following to get the ServletContext: > > ServletContext servletContext = (ServletContext) > getContext().getServerDispatcher().getContext() > .getAttributes().get("org.restlet.ext.servlet.ServletContext"); > > > Is this the recommended way to get the ServletContext? > > Ben > -- > View this message in context: http://n2.nabble.com/Obtaining-ServletContext-in-2-0-M5-tp4100861p4100861.ht ml > Sent from the Restlet Discuss mailing list archive at Nabble.com. > > ------------------------------------------------------ > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447 <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2426 398> &dsMessageId=2426398 > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447 <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2426 422> &dsMessageId=2426422 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433413

