0

According to this document, I understand a Request could be dispatch forward to another servlet in one Asynchronous Servlet which also makes container to call complete() and trigger another Servlet or JSP automatically.

But, what if I want to redirect the page under async Servlet? Should I call complete() and response.redirect("") both? do we have any example of redirection?

Thanks.

Community
  • 1
  • 1
Korben
  • 734
  • 1
  • 7
  • 26

1 Answers1

0

What you can do in this situation is that give specific json response to client (browser) using response.getWriter.write(jsonObject) and in JavaScript you write code for changing the location i.e location.assign("/newPage").

Zishan Mohsin
  • 828
  • 1
  • 9
  • 22