SystemProperties.jsp.

JAVA PRIMER
JSP: Beyond Dynamic HTML
Duane K. Fields
Listing 2. SystemProperties.jsp.


<%@ page contentType=”application/x-msexcel”
      import=”java.util.*” %>
“Property Name”,”Property Value”
<%
Properties sysprops = System.getProperties();
Enumeration keys = sysprops.propertyNames();
while (keys.hasMoreElements()) {
  String name = (String)keys.nextElement();
  String value = sysprops.getProperty(name);
%><%= name %>,<%= value %>
<% } %>

About the Author

Duane Fields is co-author of the best-selling book Web Development with JavaServer Pages. He can be contacted at [email protected].