Nagaraj,

With due respect, I would not agree about the Easy_to_reuse_code rule;
re-use is much easier if the code is encapsulated in a good bean.

But solution 3. still seems the best, although a simpler architecture could
be ok if the app is very simple and the logic is not likely to be re-used in
later projects.

/Manne

-----Original Message-----
From: G.Nagarajan [mailto:[EMAIL PROTECTED]]
Sent: 04 January 2001 12:12
To: [EMAIL PROTECTED]
Subject:


When is a jsp page good?

some rules could be
Easy_html_rule
        A html designer can easily understand and modify the page
Easy_debug_rule
        Easy to debug when an error happens
Easy_change_rule
        Easy to change code without affecting other areas
Easy_to_reuse_code
        Isolate repeated code and use it other pages.

so, when we apply the above rules it becomes clear that solution 3 is the
best.
To make it even easier for the html designer, the remaining java code can be
hidden using jsp tags.

Regards,
Nagaraj.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Hariharan N
Sent: Thursday, January 04, 2001 11:48 AM
To: [EMAIL PROTECTED]
Subject: Re:


Hi!
        This is re-post for more replies and suggestions!

      I want to display a set of employee details from database in a JSP
Page.
Which method is best suited and "WHY"?


2. Divide into
   Emp.jsp
   Database Bean
   form jsp create database bean which would fetch records form database.
Return directly the    resultset to the JSP and display the records

3.Divide into
   Emp.jsp
   Database Bean
   Employee object
   form jsp create database bean which would fetch records form database.
from the no of records fetched create as many employee objects and fill the
details and send them as a vector to jsp which it would be type casted to
employee object not bean and then values are displayed from getmethods!!!

Please explain why and which method is good... WHY..
Thanks!

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to