23 November 2005

Dumping System Properties with OC4J

A Simple Dump of System Properties from a JSP With OC4J

A point was made recenttly that a query on Google returned zero hits for showing how to print details of the runtime environment with OC4J.

So here’s my attempt at getting at least one hit for how to do this.

Assumption – OC4J is running somewhere

Step1 – Open a text editor.

Step 2 – Enter the following into the editor.

<%@ page import="java.util.*, java.io.*"%>
<h3>System Properties</h3>
Properties props = System.getProperties();
props.list(new PrintWriter(out));

Step 3 – Save the file as $ORACLE_HOME/j2ee/home/default-web-app/sysprops.jsp

Step 4 – Access the page from a browser http://localhost:8888/sysprops.