This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where to put oeject passed between applet and servlet

 
may Lee
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic