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].

Upcoming Training Events

0 AM
Visual Studio Live! San Diego
September 8-12, 2025
Live! 360 Orlando
November 16-21, 2025
Cloud & Containers Live! Orlando
November 16-21, 2025
Data Platform Live! Orlando
November 16-21, 2025
Visual Studio Live! Orlando
November 16-21, 2025