Adding a client Java Bean to an EJB Server on Windows 2000

4-9-03
The "Building an EJB Server" document must be completed before this document will work. Use this link to test your examples: http://localhost:8080/web-client.

Create a Java Bean
Create Graph2DBean.java and Graph2DBeanInfo.java files and put them in the src/main/client/netdb/Graph2DBean directory. The source for these files can be copied from the sun examples. Create a meta-inf directory under this directory, and create a manifest.mf file that contains the following:
Manifest-Version: 1.0
Name: netdb/Graph2DBean/Graph2DBean.class
Java-Bean: True

Update the Build
Add the following as another jar target.
    <jar jarfile="${build.client.dir}/Graph2DBean.jar"
       	manifest="${src.client.dir}/netdb/Graph2DBean/meta-inf/MANIFEST.MF">
        <fileset dir="${build.classes.dir}"
            includes="netdb/Graph2DBean/**" />
      </jar>

Test
Run the run.bat file that comes with the bean development kit. Select File-Load Jar, and select the Graph2DBean.jar file. The graph bean should display in the toolbox. Drop the graph bean into the BeanBox. Change the foreground and background properties.

Bean Container
To make an Applet that contains the bean, simply select File-MakeApplet in the BeanBox, and an applet will be created that contains the loaded beans. Then add a reference to support.lib from the bdk to the war target in the build.xml file. Add support.lib to the Project-Properties of Eclipse. Add support.lib to the Object tag in the jsp file.
Hosted by www.Geocities.ws

1