JSP Page to list Java System properties

<!-- jsp to list system properties and time -->
<%
        int j=45;
        java.util.Properties props = java.lang.System.getProperties();
%>
<html>
        <head><title>Hello</title></head>
        <body>
                <h1>Java System properties</h1>
                <table border="1">
                <tr>
                <td colspan="2"><center>
                <%= "Welcome Java Ver : " + java.lang.System.getProperty("os.version") %>
                </center></td>
                </tr>
                <tr><th width="30%">Name</th><th width="70%">Value</th></tr>
                <tr>
                <td>Time</td>
                <td><%= new  java.util.Date() %></td>
                </tr>
                <%
                        java.util.Enumeration allProps = props.keys();
                        while (allProps.hasMoreElements()) {
                                out.println("<tr><td>");
                                String p = (String) allProps.nextElement();
                                out.println(p+"</td><td>"+java.lang.System.getProperty(p));
                                out.println("</td></tr>");
                                }
                %>
                </table>
                </p>
        </body>
</html>

jsp_system_properties.txt · Last modified: 2014/10/26 01:52 (external edit)
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0