Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where should I put the serializable object class

 
jenny wang
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you will have to put a second copy where the Applet can see it - with the other Applet classes.
 
jenny wang
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic