Java/JSP/System Properties

Материал из Java эксперт
Перейти к: навигация, поиск

Selected System Properties

   <source lang="java">

<%--

 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>

Selected System Properties

<% 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); %> <% } %> </body>
<%= name %> <%= normalize(value) %>

</html> <%!

  private static final String normalize(String s)
  {
     StringBuffer sb = new StringBuffer();
     for (int i = 0; i < s.length(); i++) {
        char c = s.charAt(i);
        sb.append(c);
        if (c == ";")
           sb.append("
"); } return sb.toString(); }

%>


      </source>
   
  
 
  



Selected System Properties 2

   <source lang="java">

<%--

 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>

Selected System Properties

<% 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); %> <% } %> </body>
<%= name %> <%= value %>

</html>


      </source>