Hi Kumaran,
Here are what I understood>
Both the methods do the same thing, that is they create an instance of
the Java Bean Class which can be accessed else where in your JSP page.

But, the advantages of using the useBean tag are

1, You can use getProperty and putProperty methods
2, It results in lesser java code in the page.

The second point is useful if you have to handover your jsp page to
a html designer. They can learn the getProperty() and setProperty()
tags quickly rather than putting <%= %> tags. And of course you need
not worry about not closing the <% tag, which is quite a big headache
when you debug a page.

And as for converting the bean to a EJB, try to isolate the
code into that which does business login(inserting into database,
computing values, validation etc) and the code that does presentation
logic(ex, printing html). And there are some restrictions on using
threads, db connections in Ejb which you have keep in mind. Right now,
what I do is to have a helper class that handles all connecting and
disconnecting. So I just have to change one class.

Hope this helps,
Regards,
Nagaraj.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Narayanaswamy, Kumaran
(CTS)
Sent: Monday, December 04, 2000 9:54 AM
To: [EMAIL PROTECTED]
Subject: Which is the Best Method to do??


Hi All
I need some Clarification regarding which method is efficient?
I have a Javabean.I need to use it in JSP .
Can i go for usebean TaG OR instatiating the bean and access its methods
inside <% %> tag.Please also note that if the Java bean need to be Converted
to Enterprise Java Bean there should be only minimum Code Change.

with regards,
Kumaran

This e-mail and any files transmitted with it are for the sole use
of the intended recipient(s) and may contain confidential and privileged
information.
If you are not the intended recipient, please contact the sender by reply
e-mail and
destroy all copies of the original message. Any unauthorised review, use,
disclosure,
dissemination, forwarding, printing or copying of this email or any action
taken in
reliance on this e-mail is strictly prohibited and may be unlawful.

                Visit us at http://www.cognizant.com

===========================================================================
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