B
Berlin Brown
In an earlier thread. I asked about ClassCast and ClassLoader issues.
I think this could be solved with dynamic casting. Something along the
lines of:
Method m = this.getClass().getMethod("mult",
new Class[]{o.getClass(), int.class)};
m.invoke(new Object[]{o, new Integer(factor));
but cleaner:
Class c = obj.getClass();
Object o2 = session.getAttribute("some.str");
String someStr = (String) c.cast(o2);
I think this could be solved with dynamic casting. Something along the
lines of:
Method m = this.getClass().getMethod("mult",
new Class[]{o.getClass(), int.class)};
m.invoke(new Object[]{o, new Integer(factor));
but cleaner:
Class c = obj.getClass();
Object o2 = session.getAttribute("some.str");
String someStr = (String) c.cast(o2);