LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Object Reference problem in Java servlets (https://www.linuxquestions.org/questions/programming-9/object-reference-problem-in-java-servlets-334103/)

Hockeyfan 06-16-2005 12:21 AM

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?

elsheikhmh 06-16-2005 01:36 AM

do you mean that sending the Vector in HttpRequest is not working properly? i'm doubt about the container, check configurations.

what about HttpSession? use set/getAttribute()


,,
mustafa


All times are GMT -5. The time now is 05:05 AM.