This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes where should I put the serializable object class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "where should I put the serializable object class" Watch "where should I put the serializable object class" New topic
Author

where should I put the serializable object class

jenny wang
Greenhorn

Joined: Feb 23, 2001
Posts: 27
I use applet-servlet communication to forward a serializable object to my servlet. But I can't figure out where i should put my object class which both applet and servlet could refer to.
I tried to put it in the web-inf/classes/myObject.class but it not work because my applet can't access it.
Thanks for any valuable solution!!
Jenny
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
I believe you will have to put a second copy where the Applet can see it - with the other Applet classes.
jenny wang
Greenhorn

Joined: Feb 23, 2001
Posts: 27
I tried to put another copy in applet folder. But it doesn't work. The server may think they are different objects.
Jenny
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
What sort of error message do you get?
You should use try - catch in the Applet method that is supposed to deserialize the object and dump the exception information to System.out
Bill
jenny wang
Greenhorn

Joined: Feb 23, 2001
Posts: 27
I add a "System.out.println" message in servlet file and it showed up in command window(Tomcat) when I click on aplet. But I just can't get the object transfered from applet.
I wonder if there is something I didn't notice.
Thanks, Bill. I will try your way again. I will post here if I find out anything.
Jenny

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where should I put the serializable object class
 
Similar Threads
Servlet can Call an Applet
Applet-servlet commn
problem with using serializable class
problem with serializabled objects
where to put the object passed betweeb servlet and applet