Object Reference problem in Java servlets
I have written a web app in java using apache velocity and apache struts. My web app hasn't been working. I have debugged it and I found that the object references are not the same. For example, I input 3 names and addresses in a form then save them all into a vector. When I go back to the main menu and try to sort the vector the contents of the vector, a new object instance has been created with everything zeroed out. Ordinarily I would just pass a variable of the Object class I need as an extra parameter into the function however since I am overwritting the execute method of the Action class I can't.
What is the best way to keep the same object instantion throughout the whole life of the program?
Does anyone have experience with java servlets that can help me?