This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, in one of my servlets Iam setting a Vector in request attribute, but when i try to get it in my jsp its giving me an Object which Iam not able to cast to a vector. When I check it using instanceof operator it gives me false for Vector. Need your help guys... Ajay
Use o.getClass().getName() to find out what type the Class is. It is sometimes possible for a single Class to be loaded by two ClassLoaders, and in that case an instance created in CL1 is not equal to a Class created by CL2. This shouldn't be possible with a java.util.Vector though. Requests to load java.* Classes should always be passed to the system ClassLoader so that there is only a single version of the Class used by all code in the JVM. Try to imagine the concequences of having multiple definitions of java.lang.Object - Go on! Dave
Joined: Jan 14, 2004
Hi David, I already tried that, its giving me java.lang.Object.Actually I've a web service deployed on weblogic which returns a custom object. When my java client gets this object the getter method returns an java.lang.Object, and not a Vector. it might be possible that Vector might not be supported and it is returned as java.lang.Object only. iam new to web services so need your views.. Ajay