SET AS HOME PAGE

ADD TO FAVORITES / BOOKMARK THIS WEBSITE (More Details)

Introduction

Servlet

Jsp

Security

Enterprise Beans

Contact Us


Stateless Session Beans - Complete Project (Continue...)

 Introduction

To improve performance, you might choose a stateless session bean if it has any of these traits:

  • The bean’s state has no data for a specific client.
  • In a single method invocation, the bean performs a generic task for all clients. For example, you might use a stateless session bean to send an email that confirms an online order.
  • The bean fetches from a database a set of read-only data that is often used by clients. Such a bean, for example, could retrieve the table rows that represent the products that are on sale this month.
Types of Enterprise Beans are
  • Session Beans
    1.  Stateless Session Beans
    2. Stateful Session Beans
  • Entity Beans
    1. Bean Managed Persistent (BMP) Entity Beans
    2. Container Managed Persistent (CMP) Entity Beans
  • Message-Driven Bean
CLICK HERE to download this complete example (zip file)


 Steps to deploy and run this Stateless Session Bean - Continue ...

  1. Next, goto File -> New -> Web Component

    (Click Next button)


  2. (Enter the WAR Name as "SlsApp" and then click the Edit Contents… button)
  3. Select only the Loan.html and LoanServlet.class files and click the Add button


  4. (Now click the Next button)


  5. (Now select the Servlet option button and then click the Next button)


  6. (Now select the "LoanServlet" from the Servlet Class dropdown box)


  7. (Now select the Next button)


  8. (Now select the Finish button)


  9. (Now select the SlsApp in the left pane and select the General tab in the right pane. Here give a name "/loanctx" in the Context Root text box)
  10. Next select the StatelessBeanExample in the right side

    (Now select the StatelessBeanExample in the left pane and then select the Aliases tab in the right pane. Next select the Add button)


  11. (Now add a name as "servlet/LoanServlet")

  12. Select the WebApp in the left pane and then select the File Refs tab in the right pane
  13. Now click the Add File button in the Welcome Files pane and then select the Loan.html file from the drop-down box
  14. Now, select the General tab

    ( Now press Alt+S or Sun-specific Settin… button )
  15. Now a Sun-specific Settings will open as in the below picture. Here, in the Application pane specify "ejb/SimpleLoan" in the JNDI Name

    ( Now press the Close button )
  16. Now goto File ->Save
  17. Next goto Tools -> Deployee

    (Enter the User Name as “admin” and Password as “password” (CLICK HERE for password). Next click the OK button)


  18. (Now a message --- Operation Completed Successfully --- must display. Next click the Close button)
  19. Next goto File -> Exit to close it
  20. Open the Internet Explorer and type the address as http://localhost:8080/ loanctx
  21. Program completed
  22. To stop the server goto Start -> All Programs -> Sun Microsystems -> Application Server PE -> Stop Default Server. CLICK HERE to see how to Stop the Server

 Click for Next Topic
<- PREVIOUSNEXT ->