Mercurial > hg > digilib-old
comparison client/digitallibrary/server/dlRequest.jsp @ 169:93dd5e1c57d3
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 | |
children | bc9196347188 |
comparison
equal
deleted
inserted
replaced
168:cf1825c48e9d | 169:93dd5e1c57d3 |
---|---|
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 | |
26 dlRequest.setValue("pt", docBean.getNumPages(dlRequest)); | |
27 // dir cache | |
28 digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); | |
29 %> | |
30 | |
31 <html> | |
32 <head> | |
33 <title>Digilib configuration page</title> | |
34 </head> | |
35 | |
36 <body> | |
37 <h1>Local request information</h1> | |
38 | |
39 <table> | |
40 <tr> | |
41 <td>Pt</td><td><b><%= dlRequest.getAsString("pt") %></b></td> | |
42 <td><i>total number of pages (generated by servlet)</i></td> | |
43 </tr> | |
44 <tr> | |
45 <td>RequestPath</td><td><b><%= dlRequest.getAsString("request.path") %></b></td> | |
46 <td><i>url of the page/document</i></td> | |
47 </tr> | |
48 <tr> | |
49 <td>Fn</td><td><b><b><%= dlRequest.getAsString("fn") %></b></td><td><i>url of the page/document</i></td> | |
50 </tr> | |
51 <tr> | |
52 <td>FilePath</td><td><b><%= dlRequest.getFilePath() %></b></td><td><i>effective path of the page/document</i></td> | |
53 </tr> | |
54 <tr> | |
55 <td>Pn</td><td><b><%= dlRequest.getAsString("pn") %></b></td><td><i>page number</i></td> | |
56 </tr> | |
57 <tr> | |
58 <td>Dw</td><td><b><%= dlRequest.getAsString("dw") %></b></td><td><i>width of client in pixels</i></td> | |
59 </tr> | |
60 <tr> | |
61 <td>Dh</td><td><b><%= dlRequest.getAsString("dh") %></b></td><td><i>height of client in pixels</i></td> | |
62 </tr> | |
63 <tr> | |
64 <td>Wx</td><td><b><%= dlRequest.getAsString("wx") %></b></td><td><i>left edge of image (float from 0 to 1)</i></td> | |
65 </tr> | |
66 <tr> | |
67 <td>Wy</td><td><b><%= dlRequest.getAsString("wy") %></b></td><td><i>top edge in image (float from 0 to 1)</i></td> | |
68 </tr> | |
69 <tr> | |
70 <td>Ww</td><td><b><%= dlRequest.getAsString("ww") %></b></td><td><i>width of image (float from 0 to 1)</i></td> | |
71 </tr> | |
72 <tr> | |
73 <td>Wh</td><td><b><%= dlRequest.getAsString("wh") %></b></td><td><i>height of image (float from 0 to 1)</i></td> | |
74 </tr> | |
75 <tr> | |
76 <td>Ws</td><td><b><%= dlRequest.getAsString("ws") %></b></td><td><i>scale factor</i></td> | |
77 </tr> | |
78 <tr> | |
79 <td>Mo</td><td><b><%= dlRequest.getAsString("mo") %></b></td><td><i>special options like 'fit' for gifs</i></td> | |
80 </tr> | |
81 <tr> | |
82 <td>Mk</td><td><b><%= dlRequest.getAsString("mk") %></b></td><td><i>marks</i></td> | |
83 </tr> | |
84 <tr> | |
85 <td>BaseURL</td><td colspan="2"><b><%= dlRequest.getAsString("base.url") %></b></td> | |
86 </tr> | |
87 <tr> | |
88 <td></td><td></td><td><i>base URL (from http:// to below /servlet)</i></td> | |
89 </tr> | |
90 </table> | |
91 | |
92 <h2>All parameters<h2> | |
93 | |
94 <table> | |
95 <% | |
96 Object[] keys = dlRequest.keySet().toArray(); | |
97 java.util.Arrays.sort(keys); | |
98 int l = keys.length; | |
99 for (int i = 0; i < l; i++) { | |
100 String key = (String) keys[i]; | |
101 String val = dlRequest.getAsString(key); | |
102 if (val.length() == 0) { | |
103 val = "</b>(none)<b>"; | |
104 } | |
105 %> | |
106 <tr> | |
107 <td valign="top"><%= key %></td><td><b><%= val %></b></td> | |
108 <td><% if (! dlRequest.hasValue(key)) { %> (default) <% } %></td> | |
109 </tr> | |
110 <% | |
111 } | |
112 %> | |
113 </table> | |
114 | |
115 | |
116 </body> | |
117 </html> |