Does this work?
<logic:iterate name="problemArray" id="currentProb" scope="request">
    <bean:write name="currentProb" property="problemName"/> 
</logic:iterate>

If yes, make changes as the following:
<logic:iterate name="problemArray" id="currentProb" scope="request">
    <bean:write name="currentProb" property="problemName"/> 
    <html:radio name="currentProb" property="name" />
</logic:iterate>

Let me know if it works.

Charlene
-----Original Message-----
From: Jeremy Cavagnolo [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 2:41 PM
To: [EMAIL PROTECTED]
Subject: ClassCastException using type attribute with iterate tag


I wasn't exactly clear with what I am trying to do.  Here is what I really 
want to do:

<logic:iterate name="problemArray" id="currentProb" scope="request">
    <bean:write name="currentProb" property="problemName"/> 
    <html:radio property="problem" value="<%= currentProb.getName() %>">
</logic:iterate>

but when I add type="org.alf.msq.data.Problem" to my iterate tag, I get 
the ClassCastException.  Further, no matter how I try to cast an element 
of the problemArray to org.alf.msq.data, whether it is inside or outside 
the iterate tag, I get the Exception.  I even did the following:

System.out.println(problemArray.get(0).getClass().getName()); 

and it returned org.alf.msq.data.Problem!

Any insight is much appreciated.  The relevant stack trace from the log 
follows.

Thanks,

Jeremy

jsp: init
ApplicationDispatcher[/MSQ] Servlet.service() for servlet jsp threw 
exception org.apache.jasper.JasperException
        at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
        at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java)

...


----- Root Cause -----
java.lang.ClassCastException
        at org.apache.jsp.probSelect_jsp._jspService(probSelect_jsp.java:161)
        at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java)
        at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
        at org.apache.jasper.servlet.JspServlet.service(Unknown Source)

...


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