Hello all, I am encountering a ClassCastException when compiling a JSP page
in the following scenario:
1) a servlet MyInitServlet creates an object MyObject and saves it to
the context by
getServletContext().setAttribute("myobj", MyObject);
2) a JSP page tries to access MyObject by doing:
MyObject mo = (MyObject) application.getAttribute("myobj");
The above statement caused Jasper to throw a
ClassCastException.
3) I then tried by introspecting the generic object returned by
application.getAttribute()
mo2 = application.getAttribute("myobj");
And I was able to print out the class name and all the public
methods in the class associated with mo2. And everything looked right. But
the statement
mo2 instanceof MyOjbect
still evaluated to false (hence the ClassCastException)......
What did I do wrong ?
Your help is greatly appreciated!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]