`

输出所选系统属性

    博客分类:
  • JSP
阅读更多
<%--
  Copyright (c) 2002 by Phil Hanna
  All rights reserved.
  
  You may study, use, modify, and distribute this
  software for any purpose provided that this
  copyright notice appears in all copies.
  
  This software is provided without warranty
  either expressed or implied.
--%>
<%@ page session="false" %>
<html>
<head>
<title>Selected System Properties</title>
</head>
<body>
<h1>Selected System Properties</h1>
<table border="1" cellpadding="3" cellspacing="0">
<%
   final String[] propNames = {
      "java.awt.printerjob",
      "java.class.path",
      "java.class.version",
      "java.ext.dirs",
      "java.library.path",
   };
   for (int i = 0; i < propNames.length; i++) {
      String name = propNames[i];
      String value = System.getProperty(name);
%>
<tr>
   <td align="left" valign="top"><%= name %></td>
   <td align="left" valign="top"><%= normalize(value) %></td>
</tr>
<% } %>
</table>

</body>
</html>

<%!
   private static final String normalize(String s)
   {
      StringBuffer sb = new StringBuffer();
      String[] strs = s.split(";");
      for(String str : strs) {
    	  sb.append(str+"<br>");
      }
      return sb.toString();
   }
%>
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics