by Dinesh Thakur Category: JSP Elements

             This Example is use to get the Information about Server’s Information. Like port number, server name.

<html>

<head>

      <title>&lt;SnoopServer&gt;</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>

       Jsp serverSnoop Example



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.