cmanjari
asked on
JavaBean from Applet
Can anybody tell me how can I access a JavaBean from an applet?.
Thank you
Chakri
Thank you
Chakri
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi ,
Thank you very much for the information.
I am not taking abt Visual JavaBean.
My problem is,
I am storing some values in JavaBean from a servlet.From html page am calling applet to show the screen in which I have to use the values which I set in the Bean.For this I am unable to get the instance of that Bean.Can Please tell me how to do this.
Chakri
Thank you very much for the information.
I am not taking abt Visual JavaBean.
My problem is,
I am storing some values in JavaBean from a servlet.From html page am calling applet to show the screen in which I have to use the values which I set in the Bean.For this I am unable to get the instance of that Bean.Can Please tell me how to do this.
Chakri
In Beans 1.0 the given name can indicate either a serialized object or a class. Other mechanisms may be added in the future. In beans 1.0 we first try to treat the beanName as a serialized object name then as a class name.
When using the beanName as a serialized object name we convert the given beanName to a resource pathname and add a trailing ".ser" suffix. We then try to load a serialized object from that resource.
For example, given a beanName of "x.y", Beans.instantiate would first try to read a serialized object from the resource "x/y.ser" and if that failed it would try to load the class "x.y" and create an instance of that class.
If the bean is a subtype of java.applet.Applet, then it is given some special initialization. First, it is supplied with a default AppletStub and AppletContext. Second, if it was instantiated from a classname the applet's "init" method is called. (If the bean was deserialized this step is skipped.)
Note that for beans which are applets, it is the caller's responsiblity to call "start" on the applet. For correct behaviour, this should be done after the applet has been added into a visible AWT container.
Note that applets created via beans.instantiate run in a slightly different environment than applets running inside browsers. In particular, bean applets have no access to "parameters", so they may wish to provide property get/set methods to set parameter values. We advise bean-applet developers to test their bean-applets against both the JDK appletviewer (for a reference browser environment) and the BDK BeanBox (for a reference bean container).