Java Reference
In-Depth Information
<TD>Post code:</TD>
<TD><INPUT TYPE="text"
NAME= "postCode"></ TD>
<TD>Order item:</TD>
<TD><INPUT TYPE="text"
NAME= "orderItem"></ TD>
<TD><INPUT TYPE="text"
NAME= "quantity"></ TD>
<INPUT TYPE="submit" VALUE= "Send order">
An example featuring user input when the above page is displayed is shown in
Fig. 10.7 .
The bean to be used will simply hold instance variables corresponding to all form
values shown on the above page ( with identical names ) and their corresponding
accessor and mutator ('get' and 'set') methods.
We'll call our bean OrderBean and place it into package shopping
package shopping;
import java.util.*;
public class OrderBean implements
private String name;
private String addressLine1, addressLine2,
private String postCode;
private String orderItem;
private int quantity;
private Date orderDate;
public String getName()
return name;
Search WWH ::

Custom Search