This Example is use to get the Information about Server’s Information. Like port number, server name.
<html>
<head>
<title><SnoopServer></title>
</head>
<body bgcolor=”#CAE0EC”>
<table border=”1″ align=”center” cellpadding=”2px” cellspacing=”2px” align=”center”>
<tr>
<span><h2 align=”center”>Server Information</h2></td></span>
</tr>
<tr>
<td>Server Name:</td> <td><%=request.getServerName() %></td>
</tr>
<tr>
<td>ServerPort: </td> <td><%=request.getServerPort() %></td>
</tr>
<tr>
<td>Query String: </td> <td><%= request.getQueryString() %></td>
</tr>
<tr>
<td>Servlet Path: </td> <td><%= request.getServletPath() %></td>
</tr>
<tr>
<td>Server Protocol:</td> <td><%= request.getProtocol() %></td>
</tr>
<tr>
<td>Server Scheme:</td> <td><%=request.getScheme() %></td>
</tr>
<tr>
<td>RemotePort = </td> <td> <%=request.getRemotePort() %></td>
</tr>
<tr>
<td>Remote Host = </td> <td> <%=request.getRemoteHost() %></td>
</tr>
<tr>
<td>Request URI: = </td> <td><%= request.getRequestURI() %></td>
</tr>
<tr>
<td>Request Method: = </td> <td><%= request.getMethod() %></td>
</tr>
<tr>
<td>Content Length: = </td> <td><%= request.getContentLength() %></td>
</tr>
</table>
</body>
</html>