Hi,
        You can create a JavaBean (JB) object containing your EJB's data,
and pass it back to the servlet. As far as possible you should try to keep
the JSP code simple and easily modifiable. SO if you use a JB, you can use
it's getter and setter to fetch data rather than doing an EJB lookup and
fetch each time. What I'm saying is something like this..

1:) Entity EJB's encapsulate the Database.
2: Servlets query the Entity Ejb's for specific data via the Session EJb's.
Session Ejb handle the data processing for you. Entity Ejb's return their
data to the session EJbs using javabean objects.
3: JSP and Servlets can use these javabeans to get data.

This pattern is documented at  http://www.c2.com/cgi/wiki?EjbDesignPatterns

Regards,
        Anil
----------------------------------------------
Anil Colin Lobo
Senior Software Engineer
Aztec Software and Technology Services (P) Ltd.
Web: http://www.aztec.soft.net

Office Address:
Aztec Software and Technology Services (P) Ltd
23, 3rd A Cross, 18th Main, 6th Block, Koramangala, Bangalore - 560095
Phone: 091-080-5522892 extn 113


-----Original Message-----
From: Khurram Saqlain [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 20, 2000 7:53 PM
To: [EMAIL PROTECTED]
Subject: application design


I'm designing our application which looks like:

JSP/HTML          (presentation layer)
-----------
Servlets          (Application layer)
----------
EJB               (DB Layer)


My question, how should I pass data retrieved from the database
as a EJB to the JSP layer? I could pass the EJB to the presentation
layer but is there a another alternative?

Is passing an EJB to the presentation layer a good approach
when the result set contains a large number of rows?

TIA,
Khurram

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to