Oracle Logo

Example of Using No Interface View and EJB in WAR

 

No Interface View

In EJB 3.0, beans must support at least one local or remote business interface. This interface is what users will see when they use the bean. In EJB 3.1, if you are designing beans that will only be used for local clients, these beans do not need an interface.

EJB In WAR

In EJB 3.1, developers can package EJBs directly into the WAR file itself, and do not need to create a separate JAR file. Developers can place EJBs in the same folder where the Web component classes are located.

Description of Example

This example defines a no interface session bean, as well as a servlet used to invoke methods of this session bean. This session bean is not defined in a JAR file, but instead is in the package with the servlet class. The servlet will return welcome information to the customer (set by the no interface session bean).

Use This Example

Click "Run" to run this example and display greetings from the no interface session bean.