Java Reference
In-Depth Information
//This product name will then be available to any
//servlet that accesses this session variable.
if (currentProduct.equals("Checkout"))
response.sendRedirect("Checkout");
else
sendPage(response,currentProduct);
//Creates page for selection of weight.
}
private void sendPage(HttpServletResponse reply,
String product) throws IOException
{
reply.setContentType("text/HTML");
PrintWriter out = reply.getWriter();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>" + product + "</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("<CENTER>");
out.println("<H1><FONT COLOR=Red>"
+ product + "</FONT></H1>");
out.println("<BR><BR><BR>");
out.println("<FORM METHOD=POST ACTION='Weight'");
out.println("<TABLE>");
out.println("<TR>");
out.println(" <TD>Quantity required (kg)");
out.println(" <INPUT TYPE='Text' NAME='Qty'"
+ " VALUE='' SIZE=5></TD>");
out.println("</TR>");
out.println("</TABLE>");
out.println("<BR><BR><BR>");
out.println("<TABLE>");
out.println("<TR>");
out.println(" <TD><INPUT TYPE='Radio'"
+ " NAME='Option' VALUE='Add' CHECKED>");
out.println(" <FONT COLOR=blue> "
+ "Add to cart.</FONT></TD>");
out.println("</TR>");
Search WWH ::




Custom Search