@Override
public Response handleRequest(Request request) {
StringWriter stringWriter = new StringWriter();
+ template.set("currentSone", getCurrentSone(request.getToadletContext()));
try {
template.render(stringWriter);
} finally {
import net.pterodactylus.util.template.TemplateException;
import net.pterodactylus.util.template.TemplateFactory;
import net.pterodactylus.util.template.TemplateProvider;
+import net.pterodactylus.util.template.XmlFilter;
import freenet.clients.http.SessionManager;
import freenet.clients.http.ToadletContainer;
import freenet.l10n.BaseL10n;
templateFactory.addFilter("date", new DateFilter());
templateFactory.addFilter("l10n", new L10nFilter(l10n()));
templateFactory.addFilter("substring", new SubstringFilter());
+ templateFactory.addFilter("xml", new XmlFilter());
templateFactory.setTemplateProvider(new ClassPathTemplateProvider(templateFactory));
templateFactory.addTemplateObject("formPassword", sonePlugin.pluginRespirator().getToadletContainer().getFormPassword());
<?xml version="1.0" encoding="utf-8" ?>
<sone>
- <name></name>
- <requestUri></requestUri>
- <insertUri></insertUri>
+ <name><% currentSone.name|xml></name>
+ <requestUri><% currentSone.requestUri|xml></requestUri>
+ <insertUri><% currentSone.insertUri|xml></insertUri>
</sone>