Hi Peter,

In the Servlet extension, we have a ServletContextAdapter that is used to
adapt a Servlet context into a Restlet context. 

It ensures that logging and init parameters are properly exposed to your
Restlet Application. Therefore, you should be able to get your
initialization parameters simply by doing:

        String value =
getContext().getParameters().getFirstValue("myServletInitParam");

Let me know if it doesn't work as expected.

Best regards,
Jerome  

> -----Message d'origine-----
> De : news [mailto:[EMAIL PROTECTED] De la part de Peter Murray
> Envoyé : lundi 23 avril 2007 17:41
> À : [email protected]
> Objet : Getting servlet init parameters out of 'web.xml'
> 
> If I'm putting a Restlet-based server into a servlet 
> container, is there
> a way to get the <init-param> parameters out of the 'web.xml' 
> file?  If
> so, how and where?
> 
> I see 'getInitParameter()' in the ServerServlet extension
> <http://www.restlet.org/documentation/1.0/ext/com/noelios/rest
> let/ext/servlet/ServerServlet.html#getInitParameter(java.lang.
> String,%20java.lang.String)>
> but I'm not sure how to get to it in a Restlet era with no
> "RestletContainer".  (I found sample code that used RestletContainer,
> but that was before the API was finalized.)
> 
> 
> Peter
> -- 
> Peter Murray                            
> http://www.pandc.org/peter/work/
> Assistant Director, New Service Development  
> tel:+1-614-728-3600;ext=338
> OhioLINK: the Ohio Library and Information Network        
> Columbus, Ohio
> The Disruptive Library Technology Jester                
> http://dltj.org/
> Attrib-Noncomm-Share   
> http://creativecommons.org/licenses/by-nc-sa/2.5/

Reply via email to