Can you use reflection?

use Class.ForName to get the class object - then either Class.newInstance,
or use reflection to get the constructor you want and create the instance.

Kevin

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Default
Sent: 24 June 1999 15:14
To: [EMAIL PROTECTED]
Subject: JSP 1.0: Beans instantiation


Hello,
I am using JRun 2.3.2 and JSP 1.0.
Is there any simple way to instantiate a bean whose class name is
computed at request time?

Example, i'd like to do something like that:

<% String beanClassName = BeanManager.getCurrentBeanClassName(); %>
<jsp:useBean id="myBean" scope="request" class=bean_class></jsp:useBean>

I have tried the <%= bean_class %> syntax ( which works  for the value
property of the setProperty tag) but it does not work.

Thanks in advance
Jacopo.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to