Ok.  Here is the problem.  I am using Model 2 Architecture.  So my Servlet
handles all the biz logic and pushes the results that are then displayed by
jsp pages.

                Within a jsp page I grab my vector from the request like so..

                Vector mems =(Vector)request.getAttribute("response");

                        Then I try to loop around it and cast it to the appropiate 
Object. Like
so...
                <%
                for (int i=0; i < mems.size(); i++) {

                        member m = (member)mems.get(i);
                %>
                        <%=m.getFname()%>
                <%}%>


                I get a ClassCastException.   But when I do a toString on the Object
itself without casting, it specifies the package name of the object that I
am trying to cast to.

                To make matters wierder.  When I do a getClass().isInstance(THE OBJECT 
I
WANT TO CAST TO) it returns false?

                What is going on here?  Is this some classLoader issue?


                Some tips that might help figure this issue out......

                        I am importing the class I am casting, in the JSP page. like 
so..

                        <%@page import="thepackage.member, java.util.*"%>

                        And the class itself isn't in a jar.  It's in the 
WEB-INF/classes
directory.

                        I also changed the container from a Vector to an ArrayList and 
got the
same results.

                        And I can instantiate the member object itself and use it in 
the jsp
page.

                Any ideas?  Please.  Someone, HELP!!!


Reply via email to