From 521718d5ef2d7a18497bc525fb15d245f6827180 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 9 Feb 2020 06:47:05 +0100 Subject: Wiki: Add top-level redirect to Home. Change-Id: Ide7605daf4b86d71181875b25ca8a7fb747b0beb --- src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java index 0f7aa3f..090dafd 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java @@ -11,6 +11,8 @@ import io.quarkus.qute.TemplateInstance; import io.quarkus.qute.api.ResourcePath; import io.quarkus.security.Authenticated; import io.quarkus.security.identity.SecurityIdentity; +import java.net.URI; +import java.net.URISyntaxException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; @@ -28,6 +30,9 @@ import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; +import javax.ws.rs.RedirectionException; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; import org.jboss.logging.Logger; import org.jsoup.Jsoup; import org.jsoup.safety.Whitelist; @@ -54,6 +59,12 @@ public class WikiResource { @Inject SecurityIdentity identity; + @GET + @Authenticated + public Response getRoot() throws URISyntaxException { + return Response.seeOther(new URI("/wiki/Home")).build(); + } + @GET @Path("/{pageName}") @Produces(TEXT_HTML) -- cgit v1.2.3