Java Reference
In-Depth Information
￿
selection of apples/pears;
￿
entry of required weight;
￿
checking out.
If one servlet needs to transfer execution to another, then method sendRedirect of
class HttpServletResponse may be used. The initial HTML page makes use of radio
buttons ( <INPUT TYPE="Radio"...........> ).
<!-- ShoppingCart.html
Home page for a very simple example of the use
of servlets in a shopping cart application.
Demonstrates the use of session variables.
-->
<HTML>
<HEAD>
<META HTTP-EQUIV ="Pragma" CONTENT="no cache">
<META HTTP-EQUIV ="Cache-control"
CONTENT="no cache">
<META HTTP-EQUIV ="Expires" CONTENT="0">
<TITLE>Shopping Cart</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1><FONT COLOR=red>Simple Shopping Cart
</FONT></H1>
<BR><BR><BR><BR><BR>
<FORM METHOD=POST ACTION="Selection">
<TABLE>
<TR>
<TD><INPUT TYPE="Radio" NAME="Product"
VALUE = "Apples" CHECKED>
<FONT COLOR=Blue>Apples</FONT></TD>
</TR>
<TR>
<TD><INPUT TYPE="Radio" NAME="Product"
VALUE = "Pears">
<FONT COLOR=Blue>Pears</FONT></TD>
</TR>
<TR>
<TD><INPUT TYPE="Radio" NAME="Product"
VALUE = "Checkout">
<FONT COLOR=Red>
Go to checkout</P></TD>
Search WWH ::




Custom Search