Acrualy, it worked fine!!!!

I had another bug in base method, confused me.
.V

Max Cooper wrote:
There doesn't seem to be direct help. Perhaps you could do this, or find a
utility method somewhere that does it for you:

Method method = null;
Class cls = this.getClass();
while (method == null && cls != null) {
   method = cls.getMethod(methodName, args);
   cls = cls.getSuperClass();
}

Please post the answer if you find a good one.

-Max

----- Original Message -----
From: "V. Cekvenich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 29, 2003 4:12 AM
Subject: Very OT: Java Reflection?



Someone care to help me out on OT reflection?

Here is the situation:
My base class has a reflection (in execute) that does this :

Method eventMethod = this.getClass().getMethod(methodName, args);

and same class has
onDefaultExec() {}
(or full code here:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/ROOT/src/basicWeb
Lib/org/apache/basicWebLib/dispatch/BaseTilesActionHandler.java

)

The concrete (derived)  class works great with reflection, it calls the
method in that class.

However, the problem is that if the concrete class does not have a
reflected method, it won't go look back in the base class for the method
name. In my case onDefaultExec and others are in base, not the instance
class.

To restate, if I reflect for a method that is concrete class, great, but
when I reflect for a method for a base class I get
reflect.InvocationTargetException
It's not looking back.

?

tia,
Vic






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to