FileDocCategorySizeDatePackage
DummyCart.javaAPI DocGlassfish v2 API3011Fri May 04 22:34:24 BST 2007sessions

DummyCart

public class DummyCart extends Object

Fields Summary
Vector
v
String
submit
String
item
Constructors Summary
Methods Summary
private voidaddItem(java.lang.String name)

    
        
	v.addElement(name);
    
public java.lang.String[]getItems()

	String[] s = new String[v.size()];
	v.copyInto(s);
	return s;
    
public voidprocessRequest(javax.servlet.http.HttpServletRequest request)

	// null value for submit - user hit enter instead of clicking on 
	// "add" or "remove"
	if (submit == null) 
	    addItem(item);

	if (submit.equals("add"))
	    addItem(item);
	else if (submit.equals("remove")) 
	    removeItem(item);
	
	// reset at the end of the request
	reset();
    
private voidremoveItem(java.lang.String name)

	v.removeElement(name);
    
private voidreset()

	submit = null;
	item = null;
    
public voidsetItem(java.lang.String name)

	item = name;
    
public voidsetSubmit(java.lang.String s)

	submit = s;