i've seriously been at this for hour & I'm really stumped something is
missing. I can't understand why it doesn't work.
I'm trying to pass in the location of my ftl template. I read the restlet
wiki, searched the mailing list even read the source & I can't figure out
wht it doesn't work.

In MyApplication extend Application .........
I've tried....
getConnectorService().getClientProtocols().add(Protocol.FILE);

I even tried this out of disperation...


        ConnectorService cs =new ConnectorService();
        cs.setClientProtocols(UtilMisc.toList(Protocol.FILE,
Protocol.HTTP));
        setConnectorService(cs);

    @Override
    public Restlet createInboundRoot() {
        //I even added this in to get it to print out which had been set
and they were in there!
        for(Protocol p :getConnectorService().getClientProtocols()){
            Debug.log(p.getName());
        }

        // initialize the Freemarker's configuration
        configuration = new Configuration();
        configuration
                .setTemplateLoader(new ContextTemplateLoader(
                        getContext(),

"file:/D:/development/myexample/deploy/myexample-integrations/webapp/myexample-base/service"));

       Then I have this in my HtmlRepresentationHandler.....

        String templateName = "serviceInfo.ftl";
        MediaType mediaType = MediaType.APPLICATION_XHTML;
        TemplateRepresentationrep = new
TemplateRepresentation(templateName, getApp().getConfiguration(),
cleanServiceResultMapInstance(results), mediaType);

I always get the same error, I even tried other protocols to no avail.


Jan 8, 2012 4:45:58 AM org.restlet.engine.component.ClientRouter getNext
     [java] WARNING: The protocol used by this request is not declared in
the list of client connectors. (FILE)
     [java] Jan 8, 2012 4:45:58 AM
org.restlet.engine.component.ClientRouter getNext
     [java] WARNING: The protocol used by this request is not declared in
the list of client connectors. (FILE)
     [java] Jan 8, 2012 4:45:58 AM
org.restlet.ext.freemarker.TemplateRepresentation getTemplate
     [java] WARNING: Unable to get the template serviceInfo.ftl. Error
message: Template serviceInfo.ftl not found.

I've read everything on google I can find about this & no answers please
can someone help.

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

Reply via email to