Simple Example: Model 2 Hello World


The Model 2 Hello World example is a simple application used to demonstrate Ant and some of the basic concepts of the other tools. You can download the complete code for this example at www.wrox.com. Model 2 Hello World involves building, deploying, and testing an applet, a servlet, a few JavaServer Pages (JSPs), an application, several Java classes, and two Enterprise JavaBeans (EJBs).

The applet is delivered to a browser using the plugin tag from a JSP. Then, the applet talks to a servlet. The servlet communicates with the EJB server, which maps a JavaBean into the session and redirects to a second JSP. The second JSP makes a call on the JavaBean, which calls an enterprise bean, which is a session bean. The session bean in turn calls an entity bean. Here is a graphical representation:

click to expand

All of these components must be packaged and configured so they can speak to one another. In this example, we create a JAR file, an EJB JAR file, a WAR file, and an EAR file, each with the appropriate manifest and deployment descriptors using Ant.




Professional Java Tools for Extreme Programming
Professional Java Tools for Extreme Programming: Ant, XDoclet, JUnit, Cactus, and Maven (Programmer to Programmer)
ISBN: 0764556177
EAN: 2147483647
Year: 2003
Pages: 228

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net