comparison client/src/main/webapp/dlInfo-json.jsp @ 892:ba1eb2d821a2 mvnify

rearrange sources to maven directory standard
author robcast
date Tue, 19 Apr 2011 18:44:25 +0200
parents client/digitallibrary/dlInfo-json.jsp@39bd5128811c
children
comparison
equal deleted inserted replaced
891:6584af320296 892:ba1eb2d821a2
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 }
15 %><%
16 // parsing the query
17 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
18 docBean.setRequest(dlRequest);
19 %>
20 // JSON format metadata about request and image
21 {
22 <%
23 Object[] keys = dlRequest.getParams().keySet().toArray();
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 }
32 %>"<%= key %>" : "<%= val %>",
33 <%
34 }
35 %>
36 }