78
|
1 <%@ page language="java" %>
|
|
2 <%!
|
|
3 // create DocumentBean instance for all JSP requests
|
|
4 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
|
|
5
|
|
6 // initialize DocumentBean instance in JSP init
|
|
7 public void jspInit() {
|
|
8 try {
|
|
9 // set servlet init-parameter
|
|
10 docBean.setConfig(getServletConfig());
|
|
11 } catch (javax.servlet.ServletException e) {
|
|
12 System.out.println(e);
|
|
13 }
|
|
14 }
|
254
|
15 %><%
|
|
16 // parsing the query
|
78
|
17 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
|
254
|
18 docBean.setRequest(dlRequest);
|
78
|
19 %>
|
753
|
20 // JSON format metadata about request and image
|
|
21 {
|
254
|
22 <%
|
548
|
23 Object[] keys = dlRequest.getParams().keySet().toArray();
|
254
|
24 java.util.Arrays.sort(keys);
|
|
25 int l = keys.length;
|
|
26 for (int i = 0; i < l; i++) {
|
|
27 String key = (String) keys[i];
|
|
28 String val = dlRequest.getAsString(key);
|
|
29 if (val.length() == 0) {
|
|
30 val = "";
|
|
31 }
|
753
|
32 %>"<%= key %>" : "<%= val %>",
|
254
|
33 <%
|
|
34 }
|
|
35 %>
|
753
|
36 }
|