Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

The Time Bean Example

This is a very simple example of a JSP-page calling a Session Bean. The result looks like this:
The primary purpose of the example is to provide a very simple demonstration of an EJB session bean. It is not intended to be a complete example or one that could be used as a template for creating your own EJB session bean. This is an example using Geronimo 2.1, Java 1.5 and EJB 3.0.

...

MyTimeBean.java is an EJB that can tell time. The EJB is in the package 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.

...

index.jsp utilizes the MyTimeBean to tell time.

...

...

geronimo-web.xml specifies the module's information and the url for the web-app.

...

web.xml references the EJB present in the WEB-INF/classes/org/apache/geronimo/samples/mytimepak directory.

...

...

Deployment Plan for the Application

plan.xml is generated by building the sample and can be found under ./mytime-jetty/target/resources/META-INF/plan.xml to deploy on jetty or ./mytime-tomcat/target/resources/META-INF/plan.xml to deploy on tomcat following a successful build of the sample. Shown below is the deployment plan for tomcat.

...

...

Building, Configuring, and Deploying the application

...