<BR>获取HTTP头文件中Host的值:
<% String header3=request.getHeader("Host");
out.println(header3);
%>
<BR>获取HTTP头文件中accept-encoding的值:
<% String header4=request.getHeader("accept-encoding");
out.println(header4);
%>
<BR>获取客户的IP地址:
<% String IP=request.getRemoteAddr();
out.println(IP);
%>
<BR>获取客户机的名称:
<% String clientName=request.getRemoteHost();
out.println(clientName);
%>
<BR>获取服务器的名称:
<% String serverName=request.getServerName();
out.println(serverName);
%>
<BR>获取服务器的端口号:
<% int serverPort=request.getServerPort();
out.println(serverPort);
%>