diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java index 4190c2fe1705b688702272cc5b9261215781e804..6c93b0097a2ccf8dc0296cecd8127122762c0916 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java @@ -15,6 +15,8 @@ import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.lang.invoke.MethodType; +import java.net.URI; +import java.net.URISyntaxException; import java.util.ArrayList; /** @@ -44,14 +46,26 @@ public class ProjectDescriptionView { //save Description @POST - @Consumes(MediaType.TEXT_HTML) - @Path("/saveText/{text}") - public Response saveProjectText(@PathParam("text")String text){ + @Consumes(MediaType.APPLICATION_FORM_URLENCODED) + @Produces(MediaType.TEXT_PLAIN) + @Path("/saveText") + public Response saveProjectText(@FormParam("student")String student,@FormParam("project")String project,@FormParam("text")String text){ log.debug(">>> saveText: " + text); descriptionService.saveProjectText(text); - log.debug(">>> saveText"); + //TODO token + try { + URI location = new URI("../pages/eportfolio.jsp?token=test"); + log.debug("<<< saveText: redirect to " +location.toString()); + return Response.temporaryRedirect(location).build(); + + } catch (URISyntaxException e) { + e.printStackTrace(); + log.debug("saveText: redirect failed" ); + } + + log.debug("<<< saveText");log.debug(">>> saveText"); return Response.ok().build(); } diff --git a/gemeinsamforschen/src/main/webapp/pages/editDescription.jsp b/gemeinsamforschen/src/main/webapp/pages/editDescription.jsp index a56731516a2408ae71658706d83c6eca94eb07f6..d42661115387c66054fec07df7e204efe8215ac7 100644 --- a/gemeinsamforschen/src/main/webapp/pages/editDescription.jsp +++ b/gemeinsamforschen/src/main/webapp/pages/editDescription.jsp @@ -56,7 +56,7 @@ <div class="description-form-buttons"> <input type="submit"> - <button> Zurück </button> + <a href="eportfolio.jsp?token=test">Zurück</a> </div> </div>