commit | f3ac3c8c77cb032b4e0905b3810feab62a833404 | [log] [tgz] |
---|---|---|
author | Robert Munteanu <rombert@apache.org> | Thu Sep 24 10:47:44 2015 +0000 |
committer | Robert Munteanu <rombert@apache.org> | Thu Sep 24 10:47:44 2015 +0000 |
tree | 5a85c64ddfad4d9ff96fc88a73cc5ba6bfce3f45 | |
parent | 041c3ec82250f778a9c0186ec317e323b967e4a0 [diff] |
slingshot: fix usage of already closed ResourceResolver git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1705028 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/slingshot/src/main/java/org/apache/sling/sample/slingshot/comments/impl/CommentPostServlet.java b/slingshot/src/main/java/org/apache/sling/sample/slingshot/comments/impl/CommentPostServlet.java index 6cd65bc..9ff026a 100644 --- a/slingshot/src/main/java/org/apache/sling/sample/slingshot/comments/impl/CommentPostServlet.java +++ b/slingshot/src/main/java/org/apache/sling/sample/slingshot/comments/impl/CommentPostServlet.java
@@ -82,6 +82,12 @@ c.setCreatedBy(userId); this.commentsService.addComment(reqResource, c); + + + // send redirect at the end + final String path = request.getResource().getPath(); + + response.sendRedirect(resolver.map(request.getContextPath() + path + ".html")); } catch ( final LoginException le ) { throw new ServletException("Unable to login", le); } finally { @@ -89,11 +95,6 @@ resolver.close(); } } - - // send redirect at the end - final String path = request.getResource().getPath(); - - response.sendRedirect(resolver.map(request.getContextPath() + path + ".html")); } }