Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Basically a Stateful Session EJB is used whenever there is a requirement to maintain a session. The example which we are going to use is a user registration process wherein the registration process is a multi step processtwo step process. First page prompts to enter your personal credentials and second page prompts to enter your billing and credit card information. The session is maintained till the user has filled up both the jsp pages. Later the complete information is populated on to a database. The application has a Controller servlet which routes the call received from the jsp client to the Bean class, setter methods and jsp pages.

To run this tutorial, as a minimum you will be required to have installed the following prerequisite software.

...

Details on installing eclipse are provided in the Development environment section.
This tutorial is organized in the following sections:

Table of Contents

Creating a EJB Project

  1. Right click Under Project Explorer and Select New->EJB Project.


    Image Added


  2. Name the project as StatefulBean. Select Next.


    Image Added


  3. Mark the fields as suggested in the screenshot and Select Next.


    Image Added


  4. Uncheck Generate Deployment Descriptor. This is beacuse we are using annotations is our applications and so deployment descriptors are redundant entity. Select Next.


    Image Added


  5. On next screen select all default values and Select finish.


    Image Added


    This creates a skeleton for the EJB project. Next steps are adding the bean class, bean interface and setter/getter methods.
    #