Creating Your First J2EE Application

Purpose

The SAP Web Application Server provides an integrated framework for developing and using applications written according to the Java™ 2 Enterprise Edition (J2EE) standards. You can create your application using the SAP NetWeaver Developer Studio, and then deploy the application on the SAP J2EE Engine.

This guide contains the steps that you must follow to successfully develop, deploy, and run a J2EE application that consists of a session enterprise bean, a JavaBean, and a JSP component.

The objective of this simple application is to show you how to:

·        Use the J2EE toolset in the SAP NetWeaver Developer Studio when creating J2EE applications

·        Implement business logic using an enterprise bean

·        Create the front end of a J2EE application

·        Connect the front end to the underlying business component

The design implemented here is one of the possible scenarios for the Calculator application. It demonstrates the use of the model-view-controller (MVC) pattern. The model layer is represented by the Calculator session bean, which does the actual work – adds, subtracts, divides, or multiplies two arbitrary numbers. The Calculator JSP is the front end component providing the view of the application. Finally, the application uses a JavaBean in the controller layer for the communication between the front-end and the enterprise bean.

Process of Developing the Calculator Application

The SAP NetWeaver Developer Studio enables you to work either using the development configuration, or in a component-free environment. This tutorial is based on a component-free scenario.

The process of developing and deploying the Calculator application consists of the following steps:

...

·        Creating an EJB Project

·        Developing the enterprise bean

·        Assembling the enterprise bean archive

·        Creating a Web Project

·        Developing the JavaBean

·        Developing the JSP

·        Assembling the web archive

·        Assembling the application

·        Deploying and running the application on the SAP J2EE Engine.

This process is illustrated in the graphic below:

Requirements

In order to create and run the Calculator application as described in the tutorial, you have to meet the following requirements:

The SAP NetWeaver Developer Studio is installed on your computer.

You have access to the SAP J2EE Engine.

The procedures in this tutorial assume that you use the workbench default settings (Auto build, etc. ).

Where to Go from Here

Start developing your first J2EE application by creating an EJB Project.