Skip to content
Snippets Groups Projects
Commit 470d7b84 authored by tudtianus's avatar tudtianus
Browse files

fix: redirection in editdescription

parent 9f835d7b
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,8 @@ import javax.ws.rs.*; ...@@ -15,6 +15,8 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.lang.invoke.MethodType; import java.lang.invoke.MethodType;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
...@@ -44,14 +46,26 @@ public class ProjectDescriptionView { ...@@ -44,14 +46,26 @@ public class ProjectDescriptionView {
//save Description //save Description
@POST @POST
@Consumes(MediaType.TEXT_HTML) @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Path("/saveText/{text}") @Produces(MediaType.TEXT_PLAIN)
public Response saveProjectText(@PathParam("text")String text){ @Path("/saveText")
public Response saveProjectText(@FormParam("student")String student,@FormParam("project")String project,@FormParam("text")String text){
log.debug(">>> saveText: " + text); log.debug(">>> saveText: " + text);
descriptionService.saveProjectText(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(); return Response.ok().build();
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<div class="description-form-buttons"> <div class="description-form-buttons">
<input type="submit"> <input type="submit">
<button> Zur&uuml;ck </button> <a href="eportfolio.jsp?token=test">Zur&uuml;ck</a>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment