Creating and testing the "Hello World"
Example is the very first step towards learning of any application or
programming language. In the given example we are going to show you, how to
create your first hello world example in EJB and testing it. You can also create a hello world example to test your
EJB environment setup. This simple application will required three different
files to print the message.
String getAddress(); String getCompanyname(); String getResult():-These are the methods which is to be defined in the bean.
2. SessionBeanBean.java:-This is the bean of type session in which we have defined the body of the method which were declared in the
3. Main.java:-This is the client application from which we can access the methods which are defined in the bean.@EJB is the annotation
SessionBeanRemote.java
package ejb;
|
SessionBeanBean.java
package ejb;
|
Main.java
package enterpriseappee5;
|
Output of the program
Displaying Message using EJB:
|
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: EJB Hello world example View All Comments
Post your Comment