Mercurial > hg > digilib-old
annotate 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 |
| rev | line source |
|---|---|
| 78 | 1 <%@ page language="java" %> |
| 2 | |
| 3 <%! | |
| 4 // authentication stuff - robert | |
| 5 // ----------------------------- | |
| 6 // create DocumentBean instance for all JSP requests | |
| 7 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean(); | |
| 8 | |
| 9 // initialize DocumentBean instance in JSP init | |
| 10 public void jspInit() { | |
| 11 try { | |
| 12 // set servlet init-parameter | |
| 13 docBean.setConfig(getServletConfig()); | |
| 14 } catch (javax.servlet.ServletException e) { | |
| 15 System.out.println(e); | |
| 16 } | |
| 17 } | |
| 18 %> | |
| 19 | |
| 20 <% | |
| 21 // get digilib config | |
| 22 digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); | |
| 23 // parsing the query | |
| 24 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); | |
| 25 // add number of pages | |
|
168
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
26 dlRequest.setValue("pt", docBean.getNumPages(dlRequest)); |
| 154 | 27 // dir cache |
| 28 digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); | |
| 78 | 29 %> |
| 30 | |
| 31 <html> | |
| 32 <head> | |
| 33 <title>Digilib configuration page</title> | |
| 34 </head> | |
| 35 | |
| 36 <h1>Global servlet configuration</h1> | |
| 37 | |
| 38 <table> | |
|
168
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
39 <% |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
40 Object[] keys = dlConfig.keySet().toArray(); |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
41 java.util.Arrays.sort(keys); |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
42 int l = keys.length; |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
43 for (int i = 0; i < l; i++) { |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
44 String key = (String) keys[i]; |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
45 String val = dlConfig.getAsString(key); |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
46 if (key.equals("basedir-list")) { |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
47 String[] bd = (String[]) dlConfig.getValue("basedir-list"); |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
48 val = ""; |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
49 if (bd != null) { |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
50 for (int j = 0; j < bd.length; j++) { |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
51 val += bd[j] + "<br> "; |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
52 } |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
53 } |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
54 } |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
55 if (val.length() == 0) { |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
56 val = "(none)"; |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
57 } |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
58 %> |
| 78 | 59 <tr> |
|
168
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
60 <td valign="top"><%= key %></td><td><b><%= val %></b></td> |
| 78 | 61 <td></td> |
| 62 </tr> | |
|
168
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
63 <% |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
64 } |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
65 %> |
| 78 | 66 </table> |
| 67 | |
| 117 | 68 <h2>Directory cache</h2> |
| 69 | |
| 70 <table> | |
| 71 <tr> | |
| 154 | 72 <td>size (directories)</td><td><b><%= dirCache.size() %></b></td> |
| 117 | 73 <td></td> |
| 74 </tr> | |
| 75 <tr> | |
| 154 | 76 <td>numFiles</td><td><b><%= dirCache.getNumFiles() %></b></td> |
| 117 | 77 <td></td> |
| 78 </tr> | |
| 79 <tr> | |
| 154 | 80 <td>hits</td><td><b><%= dirCache.getHits() %></b></td> |
| 117 | 81 <td></td> |
| 82 </tr> | |
| 83 <tr> | |
| 154 | 84 <td>misses</td><td><b><%= dirCache.getMisses() %></b></td> |
| 117 | 85 <td></td> |
| 86 </tr> | |
| 87 </table> | |
| 88 | |
| 89 <h2>JVM configuration</h2> | |
| 90 | |
| 91 <table> | |
| 92 <tr> | |
| 93 <td>java.awt.headless</td><td><b><%= System.getProperty("java.awt.headless") %></b></td> | |
| 94 <td></td> | |
| 95 </tr> | |
| 154 | 96 <tr> |
| 97 <td>java.version</td><td><b><%= System.getProperty("java.version") %></b></td> | |
| 98 <td></td> | |
| 99 </tr> | |
|
168
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
100 <tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
101 <td>java.vendor</td><td><b><%= System.getProperty("java.vendor") %></b></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
102 <td></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
103 </tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
104 <tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
105 <td>os.name</td><td><b><%= System.getProperty("os.name") %></b></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
106 <td></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
107 </tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
108 <tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
109 <td>Runtime.maxMemory</td><td><b><%= Runtime.getRuntime().maxMemory() %></b></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
110 <td></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
111 </tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
112 <tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
113 <td>Runtime.totalMemory</td><td><b><%= Runtime.getRuntime().totalMemory() %></b></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
114 <td></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
115 </tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
116 <tr> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
117 <td>Runtime.freeMemory</td><td><b><%= Runtime.getRuntime().freeMemory() %></b></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
118 <td></td> |
|
cf1825c48e9d
Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents:
157
diff
changeset
|
119 </tr> |
| 117 | 120 </table> |
| 121 | |
| 78 | 122 </body> |
| 123 </html> |
