This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes where to put oeject passed between applet and servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "where to put oeject passed between applet and servlet" Watch "where to put oeject passed between applet and servlet" New topic
Author

where to put oeject passed between applet and servlet

may Lee
Ranch Hand

Joined: Nov 20, 2003
Posts: 68
I have Redhat 9, Apache,Tomcat 4.1.30:Tomcat is able to run at: http://local/exapples, no need http://localhost:8080/examples
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 object to Servlet with some parameters inside the object, 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 /var/www/html/appletToservlet.class.
My servlet is under $CATALINA_HOME/webapps/examples/servletToapplet.class (I am using webapp to connect Applet and servlet)
My opject class is at /jdk1.2.2/jre/classes. I have serialized this object,like the followings:

package myobjectclass.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class dataStructure extend Object implements java.io.Serializable{
...
}

My appletToServlet is like:

import myObjectclass.*;
import...;
public appletToservlet {
..}

My servletToapplet is like

import myObjectclass.*;
import...;
public servletToapplet {
..}


I can compile all these three code, but when I run from Mozilla, I get the class not found error:
myclass.dataSturcture not found.


I exactly follow http://www.j-nine.com/pubs/applet2servlet/Applet2Servlet.html, but he didn;t mention where to put the object passed between applet and servlet.Please any advise me!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: where to put oeject passed between applet and servlet