Mercurial > hg > digilib-old
view client/digitallibrary/dlContext-xml.jsp @ 298:1ecaf9c1fd8a
Servlet version 1.5.0b -- the beginning of the next generation :-)
- code restructuring to improve scaleability
- new Initialiser servlet that must be run first
- image transformation work moved to DigilibImageWorker class
- Maximum number of concurrent threads limited by Semaphore
- old JIMI toolkit implementation removed
author | robcast |
---|---|
date | Sun, 24 Oct 2004 20:23:50 +0200 |
parents | aa1920322b1a |
children | fd2ef7e46119 |
line wrap: on
line source
<%@ page language="java" %><%! // 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); } } %><?xml version="1.0" encoding="UTF-8" ?> <% // process request // get digilib config digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); // parsing the query digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); // dir cache digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); %><!-- Automatically generated XML snippet with document context --> <result> <% int pn = dlRequest.getAsInt("pn"); String fn = dlRequest.getFilePath(); String ctx = ""; digilib.io.DocuDirent f = dirCache.getFile(fn, pn, digilib.io.FileOps.CLASS_IMAGE); if (f != null) { //ctx = "hasfile:"+f.getName(); f.checkMeta(); java.util.HashMap meta = f.getFileMeta(); if (meta != null) { //ctx = "JSP:hasmeta!"; if (meta.containsKey("context")) { ctx = (String) meta.get("context"); } } } %><%= ctx %> </result>