This is my understanding. I hope I am correct.
ServletA
doPost{}{
RequestDispatcher showDispatcher = req.getRequestDispatcher("fwdinclude");
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
showDispatcher.forward(req,resp);
}
Final url on my browser is
http://localhost:8080/servlet/A ServletA
doPost{}{
RequestDispatcher showDispatcher = req.getRequestDispatcher("fwdinclude");
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
showDispatcher.include(req,resp);
}
Final url on my browser is
http://localhost:8080/servlet/A ServletA
doPost{}{
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
res.sendRedirect("fwdinclude");
}
Final url on my browser is
http://localhost:8080/servlet/fwdinclude