To begin with, what's the point of storing the package name in a variable?
The problem is that "test2" is assigned at run time, while type is assigned
at compile time (or is it the other way around? - I forget).  The container
is trying to assign a package name to type that doesn't yet exist.

Mark

-----Original Message-----
From: Piyush Srivastava [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 12:26 AM
To: Struts Users Mailing List
Subject: Help needed in define tag..........urgent


hi,

I am facing problem with the bean:define tag provided
by struts. When I directly give the package name for
the type attribute, it works fine but when we define a
variable to refer the package name and use it through
JSP expression for the type attribute. It throws class
cast exception. 

To elaborate...

The code given below works fine :

<bean:define id="formTest" scope="session" name="test"
type="com.egm.fusion.VehicleForm" />

but if I give 

<%String test2 = "com.egm.fusion.VehicleForm";%>

<bean:define id="formTest" scope="session" name="test"
type="<%=test2%>" />

It gives the following exception

java.lang.ClassCastException: java.lang.Object
        at
org.apache.struts.taglib.bean.DefineTei.getVariableInfo(DefineTei.java:87)

Can anybody help on this.

Regards,
Piyush


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to