Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

again, the class object passed between applet and servlet

 
may Lee
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class object passed between Applet on Apache web server and servelt on Tomcat. The applet first passes this object with some parameters to servlet, then servlet passes back the object with changed parameters. I check with Tomcate, this class seems should be in /common/shared/classes to be shared with all web application.

But how can applet know this class is here? Shall I include /common/shares/ in the CLASSPATH?
How applet and servlet import this class?

public class dataTransfer extends Object implements java.io.Serializable{
public int dyear,dmonth;
public dataTransfer(){
setTime(0,0);
}
public void setTime(int arg1,int arg2){
dyear=arg1;
dmonth=arg2;
}

}
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It must be in the Classpath for both. Since most Servlet Containers prevent access to these areas in means a copy in two places. One in the Webapp's classpath and one in the Applets Classpath. You set the classpath for the applet using the code or archive tags.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic