The Time Bean Example
This is an example of a JSP-page calling a Session Bean. The result looks like this:
I have tried to strip of everything just to make this example as easy as possible to understand. This is an example using Geronimo 2.0, Java 1.5 and EJB 3.0.
MyTimeBean.java is an EJB that can tell time. I have put my EJB in a package that I call org.apache.geronimo.samples.mytimepak. By using the @Stateless annotation Geronimo will recognize that this is a stateless session bean. There is no need for a ejb-jar.xml.
MyTimeLocal.java is the Local interface. As this EJB will only be used from a JSP-page that is running in the same server (same JVM) I use a Local interface that do not make use of the network.
openejb-jar.xml does nothing but specifies the module's information.
index.jsp utilizes the MyTimeBean to tell time.