+ //
+ // INTERFACE LinkEnabledCallback
+ //
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isEnabled(ToadletContext toadletContext) {
+ return true;
+ }
+
+ /**
+ * Exception that can be thrown to signal that a subclassed {@link Page}
+ * wants to redirect the user during the
+ * {@link TemplatePage#processTemplate(net.pterodactylus.sone.web.page.Page.Request, Template)}
+ * method call.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+ public class RedirectException extends Exception {
+
+ /** The target to redirect to. */
+ private final String target;
+
+ /**
+ * Creates a new redirect exception.
+ *
+ * @param target
+ * The target of the redirect
+ */
+ public RedirectException(String target) {
+ this.target = target;
+ }
+
+ /**
+ * Returns the target to redirect to.
+ *
+ * @return The target to redirect to
+ */
+ public String getTarget() {
+ return target;
+ }
+
+ }
+