Я пытаюсь передать местоположение моего шаблона ftl.
В приложении MyApplication extension
Я пытался ....
getConnectorService().getClientProtocols().add(Protocol.FILE);
Я даже пытался из-за этого ...
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"));
Тогда у меня есть это в моем HtmlRepresentationHandler .....
String templateName = "serviceInfo.ftl";
MediaType mediaType = MediaType.APPLICATION_XHTML;
TemplateRepresentationrep = new TemplateRepresentation(templateName, getApp().getConfiguration(), cleanServiceResultMapInstance(results), mediaType);
Я всегда получаю ту же ошибку, я даже пробовал другие протоколы безрезультатно.
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] WARNING: Unable to get the template serviceInfo.ftl. Error message: Template serviceInfo.ftl not found.