Creating a JSP Response Page

Servlets can invoke JSPs in two ways, the include() method
and the forward() method:

The include() method in the RequestDispatcher interface calls a JSP and waits for it to return before continuing
to process the interaction. The include() method can be
called multiple times within a given servlet.

The forward() method in the RequestDispatcher interface hands the JSP interaction control. The servlet is no
longer involved with the current interaction's output after invoking forward(), thus only one call to the forward() method
can be made in a particular servlet.

Note –

You cannot use the forward() method if you
have already defined a PrintWriter or ServletOutputStream object.

Identify which JSP to call by specifying a Universal Resource
Identifier (URI). The path is a String describing a path
within the ServletContext scope. There is also a getRequestDispatcher() method in the request object that takes a String argument
indicating a complete path. For more information about this method, see the
Java Servlet 2.3 specification, section 8.