Title: RE: when to use Bean !!!

This is what I think .

First, let me explain the design model I implement (say, a DB query application)

1. Client sends (HTML) request to servlet asking for data from db. Client submit
   userid & password.
2. Servlet conducts db access authentication
   -> if login not allowed, feebacks login page (using rd.forward)
   -> o.w, Servlet query db and generate a resultSet.  Forward the resultset to         a jsp file, say Format_RS.jsp
3. Format_RS.jsp formats the ResultSet to HTML Table (for example ) and feeback to client.  ( I am experimenting using Format_RS.jsp just to generate a HTML string (eg  HTML_out =" <Table> ..  </Table>).  After that, fowards the HTML string to another jsp Prsent_RS.jsp to display in client's browser)

(client -> servlet -> format_rs.jsp -> prsent_RS.jsp - client. Javabean only provides support functionalities)

I use java beans in servlet and jsp. Just like I use DLL functions in windows application.  In the above model, servlets only take care of the business logic. Prsenting info to client is jsp's tasks. 

Personally, I don't like to use javabeans in JSP to connect/query DB, since it is too messy to mix up HTML and jsp tags.  As well, I don't use javebean to format resultset either.  Simplily because I don't want to recompile the javabean source code to make a change in display.  A text editor and a non java programmer and do the job.

I will highly appreciate someone points out my mistake and give me suggestion.

Sincerely

Jeff

-----Original Message-----
From: Carlos H. L�pez [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 25, 1999 8:25 AM
To: [EMAIL PROTECTED]
Subject: Re: when to use Bean !!!


I want to add to this question, When use a Bean and When to use a
Servlet?

Thanks, Carlos.

"The successful man make their own opportunities."


"ACI Team (Chennai)" wrote:
>
> Hi
>         Does any one has clear picture of when to use bean in Jsp....
> Help of any sort appreciated..
>
> Aciteam
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to