Howdy,

>Okay, here I am, my first Java lines. I downloaded tomcat 4.1.27
sources
>and perform the following in :
>src/share/org/apache/catalina/logger/FileLogger.java
>
>Added a line
>
>import java.lang.String;
>
>In the import part of the file, Added :
>
>private String localhostname = "";
>
>to define the string near the suffix String declaration.
>
>Then, I fetch the local host name like this :
>
>    public String getLocalHostName() {
>
>        return (localhostname);
>
>    }

Do you set localhostname anywhere?  Try this:

private String localHostName = null;
protected String getLocalHostName() {
  if(localHostName == null) {
    try {
      InetAddress localHost = InetAddress.getLocalHost();
      localHostName = localHost.getHostName();
    } catch (Exception e) {
      localHostName = "error";
    }

  return localHostName;
}

You need to import java.net.InetAddress for the above to compile.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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

Reply via email to