File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 12675
    
    5
I believe you will have to put a second copy where the Applet can see it - with the other Applet classes.


Java Resources at www.wbrogden.com
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: 12675
    
    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
problem with serializabled objects
problem with using serializable class
Servlet can Call an Applet
Applet-servlet commn
where to put the object passed betweeb servlet and applet