ISDV 547 Lab 1-EJB: Objective
ISDV 547 Lab 1-EJB: Objective
ISDV 547 Lab 1-EJB: Objective
Lab 1- EJB
Objective
The purpose of this lab is to develop an EJB application
Description
Task 1: Developing EJB using NetBeans
In this lab, you will develop a very simple EJB application, and then implement an EJB client
which is a JSP file in this case.
To do this , create a new project, from categories select Java EE and from Projects, select
Enterprise Application
Give a name to the Ejb project, EjbLab.
Click on Next. Select the following options:
Then, click on Finish.
In the project navigator, you will see three projects have been created: EjbLab, EjbLab-
ejb, EjbLab-war
EjbLab contains all packages including war and jar files as well as application descriptor
xml file
Now you need to create a library project. Go to “New Project->Java->Java Class
Library”. The project name would be “EJBRemoteLib” then click finish.
EjbLab-jar contains all EJB files. In order to develop your EJB application, first you
should open this project. Then, right-click on Source packages, then select New>Session
Give a name to your Ejb such as “SayHello”, type a package like “session” and check
Stateless, Remote and Local interface.
When, you click on Finish, you will see three class files: one EJB session bean and 2
interfaces including remote and local interface are created. Note that the remote
interface is under “EJBRemoteLib”.
Now, you should implement methods for local and remote interfaces. For this,
double click on the bean, SayHelloBean.
In the code, right-click on editor, select Insert Code and then select Add Business
Method:
Enter the name of your business method and specify the return type:
</body>
</html>
As you see in the picture, you should import the required classes into the jsp, then implement
locating and invoking the EJB remote interface. You should also import the EJB package,
Hello.
Click on Finish
You will see application.xml is added to your EJB package
Deliverables
When your program is complete, submit and show it to your instructor.