July 12th, 2002, 08:51 AM
how to allow jsp and applet to access common class instance
how can a jsp file and an applet in that jsp file both access the get/set method of an instance of one particular class ?
1. where do i store the applet class, and the accessor class, can i use codebase and store applet class also in WEB-INF/classes where the accessor class is currently ? if yes how ? (i tried using codebase="../WEB-INF/classes" but it does not work
2. suppose class name is Bid,
first jsp creates instance Bid b = new Bid()
and sets some property
but then applet class will create another instance
Bid b = new Bid()
but this will not get the same value since a new isntance is created .. is the only solution using static method ??
July 12th, 2002, 09:25 AM
You cannot have an applet get a reference to an object created by a jsp. One is client side and one is server side. They are running in completely different environments. The most you could do is have the applet connect to a servlet/jsp on the same server and have it send over an object via an ObjectStream.