Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Re: WhoAmI

Michael Weller

2004-07-15

Replies:

sergiodegioia@(protected):

>How can a class discover in a static context what fully qualified name is its own?
>
>package unknown;
>class WhoAmI{
>private static final className = ...????;
>}
>
>I can't use, of course, this.getClass().getName().
>
>
What about 'String myName = new
Exception().getStackTrace()[0].getClassName();'?

-mw

___________________________________________________________________________
To unsubscribe, send email to listserv@(protected)
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
©2008 junlu.com - Jax Systems, LLC, U.S.A.