/*
- * Sone - FreenetTemplatePage.java - Copyright © 2010–2016 David Roden
+ * Sone - FreenetTemplatePage.java - Copyright © 2010–2019 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import java.util.logging.Level;
import java.util.logging.Logger;
+import net.pterodactylus.sone.main.Loaders;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.TemplateContextFactory;
/**
* Base class for all {@link Page}s that are rendered with {@link Template}s and
* fit into Freenet’s web interface.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
/** The template to render. */
private final Template template;
+ private final Loaders loaders;
/** Where to redirect for invalid form passwords. */
private final String invalidFormPasswordRedirectTarget;
- /**
- * Creates a new template page.
- *
- * @param path
- * The path of the page
- * @param templateContextFactory
- * The template context factory
- * @param template
- * The template to render
- * @param invalidFormPasswordRedirectTarget
- * The target to redirect to if a POST request does not contain
- * the correct form password
- */
- public FreenetTemplatePage(String path, TemplateContextFactory templateContextFactory, Template template, String invalidFormPasswordRedirectTarget) {
+ public FreenetTemplatePage(String path, TemplateContextFactory templateContextFactory, Loaders loaders, Template template, String invalidFormPasswordRedirectTarget) {
this.path = path;
this.templateContextFactory = templateContextFactory;
+ this.loaders = loaders;
this.template = template;
this.invalidFormPasswordRedirectTarget = invalidFormPasswordRedirectTarget;
}
* wants to redirect the user during the
* {@link FreenetTemplatePage#processTemplate(FreenetRequest, TemplateContext)}
* method call.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public static class RedirectException extends Exception {