// Get the dispatcher; it gets the main page to the user
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(
"/bookstore/bookstore.html");
if (dispatcher == null) {
System.out.println("There was no dispatcher");
// No dispatcher means the html file could not be found.
response.sendError(response.SC_NO_CONTENT);
} else {
System.out.println("There is a dispatcher");
// Get or start a new session for this user
HttpSession session = request.getSession();
// Send the user the bookstore's opening page
dispatcher.forward(request, response);
}