1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Rep Power

    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 ??

  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Lincoln, NE. USA
    Rep Power
    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.

IMN logo majestic logo threadwatch logo seochat tools logo