Hi Alex,

thanks for the details.
Basically, the ClientResource needs a dedicated client inside its context
(in a wide sense). When hosted by a Component, such Context (in the sense
of instance of Context class or subclass) is provided by the Component
itself (it is a ComponentContext), which at the end calls the Component
client router that relies on the registered client connectors.
What you need is a kind of such router. You can either set it at the
Application level by overriding the createOutboundRoot method, or at the
application's context level using the Context#setClientDispatcher method.

Please feel free to ask for more details.

Best regards,
Thierry Boileau


Hi Thierry,
>
> I understand how to set the protocol on Component. My problem is more
> fundamental than that I think. When working with ServletAdapter, I don't
> have a reference to Component anywhere at hand that I can find. The only
> Restlet framework classes that I'm manipulating in my HttpServlet derived
> class are Application, Context and ServerAdapter.
>
> Do I need to 'new' a Component and manipulate its configuration similar to
> how ServerServlet is doing and eventually cause it to run? Intuitively to
> me this doesn't sound correct since I assume that's the role of
> ServerAdapter?
>
> Thanks,
>
> Alex
>
> On Feb 29, 2012, at 3:55 AM, Thierry Boileau-3 [via Restlet Discuss] wrote:
>
> Hello Alex,
>
> did you try to update the list of client connectors registered by the
> Component?
> You can make a call such as Component#getClients().add(Protocol.CLAP);
>
> Best regards,
> Thierry Boileau
>
>
> Hi,
>>
>> I am integrating Guice and Restlet in an approach that involves using
>> ServletAdapter instead of wiring up ServerServlet. Everything works fine
>> until I want to involve a representation that comes from Freemarker.
>>
>> The problems seem to come from the fact that I can't properly set the
>> client
>> protocol and the Component level in Restlet when I'm using ServletAdapter.
>> Freemarker and Restlet work OK together for me when I use ServerServlet
>> and
>> set the CLAP protocol through web.xml.
>>
>> Unless I'm missing something, I cannot find a way to set the CLAP protocol
>> into Component when using ServletAdapter.
>>
>> I can provide code snippets if it helps.
>>
>> Any suggestions? Thanks!
>>
>> --
>> View this message in context:
>> http://restlet-discuss.1400322.n2.nabble.com/USing-Freemarker-with-ServletAdapter-tp7327160p7327160.html
>> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2927727
>>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://restlet-discuss.1400322.n2.nabble.com/USing-Freemarker-with-ServletAdapter-tp7327160p7328614.html
>  To unsubscribe from USing Freemarker with ServletAdapter, click here.
> NAML<http://restlet-discuss.1400322.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
> ------------------------------
> View this message in context: Re: USing Freemarker with 
> ServletAdapter<http://restlet-discuss.1400322.n2.nabble.com/USing-Freemarker-with-ServletAdapter-tp7327160p7329508.html>
>
> Sent from the Restlet Discuss mailing list 
> archive<http://restlet-discuss.1400322.n2.nabble.com/>at Nabble.com.
>

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

Reply via email to