Re: WhoAmI

Carlos Delgado <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Hello.

The workaround is to create an object of that class:

package tmp;

class WhoAmI
{
        private static String className;

        public static void accion ()
        {
                className = new WhoAmI ().getClass().getName();
                System.out.println (className);
        }

        public static void main (String args[])
        {
                accion ();
        }

}

Good bye.



>From: "[email protected]" <[email protected]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>         Servlet API Technology." <[email protected]>
>To: [email protected]
>Subject: WhoAmI
>Date: Tue, 13 Jul 2004 19:01:00 +0200
>
>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().
>
>Tnx for ur replay
>
>___________________________________________________________________________
>To unsubscribe, send email to [email protected] and include in the body
>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

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger:
http://messenger.latam.msn.com/

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.