Skip to content

Commit

Permalink
Proposed resolution for issue eclipse-ee4j#4649
Browse files Browse the repository at this point in the history
Simple code changes to resolve eclipse-ee4j#4649
  • Loading branch information
mmariotti authored Oct 24, 2019
1 parent 05cd14d commit 95f98f2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public void redirect(String requestURI) throws IOException {
doLastPhaseActions(ctx, true);

if (ctx.getPartialViewContext().isPartialRequest()) {
if (getSession(true) instanceof HttpSession &&
if (response instanceof HttpServletResponse &&
ctx.getResponseComplete()) {
throw new IllegalStateException();
}
Expand All @@ -731,8 +731,10 @@ public void redirect(String requestURI) throws IOException {
pwriter.startDocument();
pwriter.redirect(requestURI);
pwriter.endDocument();
} else {
} else if (response instanceof HttpServletResponse) {
((HttpServletResponse) response).sendRedirect(requestURI);
} else {
throw new IllegalStateException();
}
ctx.responseComplete();

Expand Down

0 comments on commit 95f98f2

Please sign in to comment.