Code example for Vector

Methods: copyInto, size

0
    public void setSubmit(String s) {
	submit = s;
    } 
 
    public String[] getItems() {
	String[] s = new String[v.size()];
	v.copyInto(s);
	return s;
    } 
     
    public void processRequest(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);