> > -----Message d'origine-----
> > De : news [mailto:news <at> sea.gmane.org] De la part de Peter Murray
> > Envoyé : mardi 24 avril 2007 22:09
> > À : discuss <at> restlet.tigris.org
> > Objet : Example of a Restlet Application/Servlet using both 
> > Client and Server
> > 
> > In addition to operating as a Restlet-based server, it uses the REST
> > client capabilities to pull files from the digital object repository.
> > In the case of the "GetFullDisplay" class, it uses the 
> > built-in Restlet
> > TransformRepresentation to apply an XSLT stylesheet to a 
> > Dublin Core XML
> > file.

Looking at Peter's code I had a question about the best way to use a client
connector from within a Restlet application. Peter's code is instantiating a new
HTTP client connector and using. 

My impression from the design is that Client connectors, along with Server
connectors should be added to the Component and automatically selected based on
the url when dispatching calls using getDispatcher(). Is that correct?

Specifically when using Restlet embedded in a servlet container, how do we get
access to the underlying Component created by the ServerServlet? And when should
one add the client connectors to it?

Last question, related to dispatching calls to client connectors is about
request, response and request headers: what if I want to dispatch N number of
times before returning a response to the browser and for every dispatch there
are, for instance, different headers I want to submit (maybe authentication
headers, for instance, or a X-JSON header. Should I save the current state of
the request, response and modify them for each dispatch, reverting to the saved
one before returning the response?

thanks,

-- yuri 

Reply via email to