}
// set content-type header before accessing Writer
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Currency c = (Currency)session.getAttribute("currency");
if (c == null) {
c = new Currency();
c.setLocale(request.getLocale());
session.setAttribute("currency", c);
}
c.setAmount(cart.getTotal());
// then write the data of the response
out.println("<html>" +
"<head><title>" + messages.getString("TitleCashier") + "</title></head>");
// Get the dispatcher; it gets the banner to the user
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/banner");
if (dispatcher != null)
dispatcher.include(request, response);
// Print out the total and the form for the user
out.println("<p>" + messages.getString("Amount") +
"<strong>" + c.getFormat() + "</strong>" +
"<p>" + messages.getString("Purchase") +
"<form action=\"" +
response.encodeURL(request.getContextPath() + "/bookreceipt") +
"\" method=\"post\">" +
"<table summary=\"layout\">" +