LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-16-2005, 12:21 AM   #1
Hockeyfan
Member
 
Registered: May 2004
Distribution: SuSe 10.0
Posts: 154

Rep: Reputation: 30
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?
 
Old 06-16-2005, 01:36 AM   #2
elsheikhmh
Member
 
Registered: Aug 2004
Location: Cairo, Egypt
Distribution: Slackware
Posts: 101

Rep: Reputation: 15
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hypothetical qu; java servlets for streaming audio? german Programming 0 02-03-2005 11:44 AM
Java Applets Konqueror Object Tag lel800 Programming 0 12-30-2004 02:40 PM
how do i set up a webserver using mandrake 10 to use java servlets almvtb Mandriva 0 06-29-2004 03:21 PM
java object with a String and an Image exodist Programming 1 05-15-2004 12:36 AM
returning a reference to Object C++ chens_83 Programming 3 10-10-2003 09:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration