shelby
Posts: 1
Nickname: shelby
Registered: Jul, 2002
|
|
how can I get back the vector?
|
Posted: Jul 21, 2002 3:41 AM
|
|
Advertisement
|
I have a java bean under directory oz/a3/Memory.java This memory.java will add element to a vector and it has:
package oz.a3;
private Vector cart = new Vector();
public Memory(String id) { this.id = id; cart.addElement(id); }
public Iterator getVector() { return cart.iterator(); }
So i have this page call checkout.java, that, when customer checkout, his items will be stored in vector, using the above bean. It looks like:
import oz.a3; ... ... for (; enum.hasMoreElements(); ) { String name = (String)enum.nextElement(); String[] arr = (String[])session.getAttribute(name); String desc = arr[1]; String id = arr[0]; Memory v = new Memory(id); // Add ID into vector }
Then in manager.java, i want to retrieve the vector. How do I retrieve? Is it something like?
import oz.a3;
Iterator folio = getVector(); //but it gives me error says: Method getVector not found in this manager.
Then i tried: Iterator v = oz.a3.getVector(); //the error is: Undefined variable, class, or package name: oz
So how should I get back the vector?
|
|