Jsp read attribute server

  Abstract: jsp read attribute server 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> 
  <table Width="734" border="0"> <tr> <td width="728"> </ td> </ tr> </ table> 
  <% @ Page contentType = "text / html; gb2312 charset ="%> 
  <% @ Page import = "java.util .*"%> 

<head>



  </ Head> 

  <body Bgcolor="#FFFFFF" text="#000000" leftmargin="10" topmargin="10" marginwidth="0" marginheight="0"> 
  <table Width="80%" border="0" cellspacing="1" cellpadding="4"> 
<tr>
  <td Colspan="2" bgcolor="#8CC2E3"> JSP Info v1.0 </ td> 
  </ Tr> 
<tr>
  <td Colspan="2" bgcolor="#DEEEF8"> Author: Snowman Web: 

  Http://www.xinboard.net 
  </ Td> 
  </ Tr> 
  <tr Bgcolor="#FFFFFF"> 
  <td Colspan="2" height="50"> </ td> 
  </ Tr> 
  <tr Bgcolor="#B4D8ED"> 
  <td Width="30%"> Environment (Environment) </ td> 
  <td Width="70%"> Values (value) </ td> 
  </ Tr> 
  <tr Bgcolor="#DEEEF8"> 
  <td Bgcolor="#DEEEF8"> Server name (the name of the server) </ td> 
  <td> <% = Request.getServerName ()%> </ td> 
  </ Tr> 
  <tr Bgcolor="#DEEEF8"> 
  <td> Server port (server ports) </ td> 
  <td> <% = Request.getServerPort ()%> </ td> 
  </ Tr> 
  <tr Bgcolor="#DEEEF8"> 
  <td> Remote IP address (the client IP address) </ td> 
  <td> <% = Request.getRemoteAddr ()%> </ td> 
  </ Tr> 
  <tr Bgcolor="#DEEEF8"> 
  <td Colspan="2"> Context attributes (associated attributes) </ td> 
  </ Tr> 
<%
  ServletContext context = getServletContext (); 
  Enumeration enum = context.getAttributeNames (); 
  While (enum.hasMoreElements ()) ( 
  String key = (String) enum.nextElement (); 
  Object value = context.getAttribute (key); 
  Out.println ( "<tr bgcolor=#DEEEF8> <td>" + key + "</ td> <td>" + + value, "</ td> </ tr>"); 
  ) 

%>
  <tr Bgcolor="#FFFFFF" valign="bottom"> 
  <td Colspan="2" height="50"> End (concluded) </ td> 
  </ Tr> 
  </ Table> 
  </ Body> 
  </ Td> </ tr> <tr> 

  ↑ Back 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags: , ,

Releated Java Articles

Comments

Leave a Reply