i have tried your program but using as consturctor not as a bean and
working.
i deleted System.out.println("Hello world") from your java file and in jsp
file i puted
<%@ page import yourjavafile.java%>
<%
Test str_test = new Test();
String query1="select name from usermaster";
str_test.queryset(query1);
out.println("query has been set");
%>
and its ran well .. no error ..
-----Original Message-----
From: Veronique Dupierris [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 26, 2000 4:35 PM
To: [EMAIL PROTECTED]
Subject: Re: bean and jsp question
If you want to use the useBean tag, your constructor should NOT have
argument.
That's a part of the beans definition.... Of course you could find a
workaround.
<jsp:useBean id="toto" class"..." scope="..." >
<% toto.init(arg1, arg2); %>
</jsp:useBean>
The code between <jsp:useBean..> and </jsp:useBean> is only executed
when the
instance is created ....
Hope this help
Regards
Veronique
Mike Lai a �crit :
> Hi,
>
> I just start learning jsp and java bean, please give me some hint.
>
> My question is: can a bean has constructor that takes argument? If yes,
> how can I pass the argument using the <jsp:useBean> tag to do it?
> Thank you very much.
>
> Mike
>
>
===========================================================================
> 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
===========================================================================
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