Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Time Bean Example

UNDER CONSTRUCTION

This is an example of a JSP-page calling a Session Bean. The result looks like this:

...

First you have some stuff that I don't know what good they are, for example the display-name tag. You can write what ever there I guess. It seams totaly unnessesary to me, but I have not tested what happens if I take it away. What does matter is the tags ejb-name, local-home, local, ejb-class, session-type. I think that the ejb-name is part of what clients use to locate the bean (see the next xml-file). The local-home, local and ejb-class tags points out the classes. Session type tells if it is a statefull or stateless session bean. Transaction type doen't make sence I think, there is no transactions in a session bean, is there? I have tryed to read more about this deployment descriptors here: http://cwiki.apache.org/GMOxDOC11/deployment-plans.htmlImage Removed But I have not bean able to figure it out. On the other hand, I don't think ejb-jar.xml files are needed in the next generation EJB 3.0 so perhaps one should not spend to much time trying to understand it.
Here comes the openejb-jar.xml file:

...

This file is pretty empty. The only thing of importance is the artifactId, it shows if you look a the lists of modules at http://localhost:8080/console/portal/apps/apps_earImage Removed like this: default/MyPhonebook_ArtifactId/1.0/car
(Anybody knows what "car" stands for?)
Allright, this is how I have organised my files :

...

Now we can look at the application at http://localhost:8080/mytimeImage Removed

The whole source code can be downloaded in this zip-file: mytime.zip

Next: the CMP EJB phonebook example.

--------------------------------------------------------------------------------
By Mattias Malmgren mattias@freefarm.se
2006-09-28