The JSP page will always use the no argument constructor. If you need to
create a bean using a constructor with arguements then you will have to
use a scriptlet in the page.
IMO, a JavaBean should be able to be constructed with either constructor
since JavaBeans are required to have a no-argument constructor to allow
them to function with an IDE. Constructors with arguments should simply
be convenience methods that are functionally equivalent to using the
no-argument constructor and one or more setXXX() property calls.
Dave Bolt
ATSC/SPAWAR ASAT Team
Bolt's Law of Bandwidth - There is always plenty of network bandwidth, just
none for you.
-----Original Message-----
From: Pranav Bansal [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 26, 2000 1:40 AM
To: [EMAIL PROTECTED]
Subject: Constuctor overloading in Java Bean
Hi all,
Is it possible to do the Constructor Overloading in A Java Bean?
If yes, then which constructor'll be called when we use this Java Bean in a
Jsp Page using <jsp:useBean> tag?
For ex. lets take the following bean.....
public class testbean
{
public testbean()
{
System.out.println("Hello World");
}
public testbean(String s)
{
System.out.println(s);
}
}
With Regards,
Pranav Kumar
Software Engineer
Informica India Pvt. ltd.
Noida,India
Phone: -91-118-4514702
www.informica.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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".
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