request.getRemoteAddr()返回一个String 是本机地址要想得到服务器的地址:import java.net.*;
public class catchserverip{
InetAddress ServerIPaddress=null;
//取得Server的IP地址
public InetAddress getServerIP() {
        try { ServerIPaddress=InetAddress.getLocalHost();}
        catch (UnknownHostException e) {}
        return (ServerIPaddress);
}
}就可以了
在jsp中写
<jsp:useBean id="catchipbean" scope="page" class="catchip" />
String servername=catchipbean.getServerIP().getHostName();