SystemProperties.jsp 904 B

1234567891011121314151617181920212223242526272829303132333435
  1. <%@ page import="java.util.*" %>
  2. <%@ page contentType="text/html;charset=euc-kr" %>
  3. <%
  4. Date today = new Date(System.currentTimeMillis());
  5. out.println("Today: " + today.toString());
  6. out.println("<br>");
  7. // START getprops
  8. Properties props = System.getProperties(); // get list of properties
  9. // Print properties using Enumeration
  10. for (Enumeration enum1 = props.propertyNames(); enum1.hasMoreElements();) {
  11. String key = (String)enum1.nextElement();
  12. out.println(key + " = " + (String)(props.get(key)));
  13. out.println("<br>");
  14. }
  15. // END getprops
  16. // START getprop
  17. // get user's home directory
  18. String homeDir = System.getProperty("user.home");
  19. // If 'outDir' not found, use 'homeDir' as default
  20. String outDir = System.getProperty("testdir", homeDir);
  21. // END getprop
  22. out.println("homeDir: " + homeDir);
  23. out.println("<br>");
  24. out.println("outDir: " + outDir);
  25. out.println("<br>");
  26. %>