Apache web server is running, the home folder is /usr/www/html/
I want to pass a object(my own class) between applet and a servlet. First the Applet passes the opject to Servlet with some parameters, then servlet receives this object and change some data inside the object and pass it back to applet.
My applet is under Apache web server home folder. My servlet is under $CATALINA_HOME/webapps/examples/ (I am using webapp to connect Applet and servlet) Now, where shall I put my class, the object passed between applet and servlet? It should be a class like the normal Java public class. I have serialized this object. like the followings:
If the servlet is to deserialize the object, it must be able to locate the class file. If the servlet lives in /examples, one place you could put the class file is /examples/WEB-INF/classes/yourpackage/dataStructure.class (your class MUST be in a package) Naturally the applet must also be able to load the class, but this can't be done from the WEB-INF hierarchy so the class file must also appear where the browser can get it. See the Tomcat documentation for where to locate classes that need to be visible from more than just one web application. Bill
Joined: Nov 20, 2003
If I put my package in the public Java home, then import my class both in Servlet and Applet, it sould work even my applet and servlet are in other two different folder?