view client/digitallibrary/server/dlConfig.jsp @ 168:cf1825c48e9d

Servlet Version 1.16b2 with new DigilibParameter code. - more generic class for request parameters - like already done for DiglibConfig - changes in JSPs for new request stuff - changes in ImageSize class so size=0 is "wildcard" - missing dw and dh parameters now treated as wildcards - changed package name in imageinfo class
author robcast
date Wed, 29 Oct 2003 22:45:51 +0100
parents 4879b944bb03
children 84bfba8a1c9e
line wrap: on
line source

<%@ page language="java" %>

<%!
// authentication stuff - robert
// -----------------------------
// create DocumentBean instance for all JSP requests
digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();

// initialize DocumentBean instance in JSP init
public void jspInit() {
    try {
        // set servlet init-parameter
        docBean.setConfig(getServletConfig());
    } catch (javax.servlet.ServletException e) {
        System.out.println(e);
    }
}
%>

<%
// get digilib config
digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig();
// parsing the query
digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
// add number of pages
dlRequest.setValue("pt", docBean.getNumPages(dlRequest));
// dir cache
digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache");
%>

<html>
<head>
<title>Digilib configuration page</title>
</head>

<h1>Global servlet configuration</h1>

<table>
<%
    Object[] keys = dlConfig.keySet().toArray();
    java.util.Arrays.sort(keys);
    int l = keys.length;
    for (int i = 0; i < l; i++) {
	String key = (String) keys[i];
	String val = dlConfig.getAsString(key);
	if (key.equals("basedir-list")) {
	    String[] bd = (String[]) dlConfig.getValue("basedir-list");
	    val = "";
	    if (bd != null) {
		for (int j = 0; j < bd.length; j++) {
		    val += bd[j] + "<br> ";
		}
	    }
	}
	if (val.length() == 0) {
	    val = "(none)";
	}
%>
  <tr>
    <td valign="top"><%= key %></td><td><b><%= val %></b></td>
    <td></td>
  </tr>
<%
       }
%>
</table>

<h2>Directory cache</h2>

<table>
  <tr>
	<td>size (directories)</td><td><b><%= dirCache.size() %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>numFiles</td><td><b><%= dirCache.getNumFiles() %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>hits</td><td><b><%= dirCache.getHits() %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>misses</td><td><b><%= dirCache.getMisses() %></b></td>
    <td></td>
  </tr>
</table>

<h2>JVM configuration</h2>

<table>
  <tr>
	<td>java.awt.headless</td><td><b><%= System.getProperty("java.awt.headless") %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>java.version</td><td><b><%= System.getProperty("java.version") %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>java.vendor</td><td><b><%= System.getProperty("java.vendor") %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>os.name</td><td><b><%= System.getProperty("os.name") %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>Runtime.maxMemory</td><td><b><%= Runtime.getRuntime().maxMemory() %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>Runtime.totalMemory</td><td><b><%= Runtime.getRuntime().totalMemory() %></b></td>
    <td></td>
  </tr>
  <tr>
	<td>Runtime.freeMemory</td><td><b><%= Runtime.getRuntime().freeMemory() %></b></td>
    <td></td>
  </tr>
</table>

</body>
</html>