annotate client/digitallibrary/contexto/contexto.jsp @ 342:32b951b46563

Servlet version 1.5.7b - new max-waiting-threads parameter and handling - DocumentBean also gets real image sizes (for dlInfo-xml et al.)
author robcast
date Fri, 22 Apr 2005 19:16:41 +0200
parents cd013d3a0e55
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
223
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
1 <%@ page language="java" %>
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
2 <%@ page import="java.io.*" %>
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
3 <%@ page import="java.net.*" %>
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
4
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
5 <%
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
6 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
7 dlRequest.setWithRequest(request);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
8
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
9 %>
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
10
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
11 <%
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
12 // Possible parameters
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
13 String htmlPage = request.getParameter("htmlPage");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
14 // neu eingebaut - christian
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
15 // @beat: kannst du das zeugs bitte checken und mir sagen, ob du
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
16 // dagegen bist oder nicht. es ist ein uebler hack, der keine
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
17 // kontrollmechanismen hat, aber im moment halt meinen anspruechen
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
18 // genuegt. (den import von java.net.* ist auch von mir)
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
19 String htmlURL = request.getParameter("htmlURL");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
20 String xmlURL = request.getParameter("xmlURL");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
21 String xslURL = request.getParameter("xslURL");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
22 String fileName = request.getParameter("fn");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
23 String pageNumber = request.getParameter("pn");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
24
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
25 // funcktioniert leider nicht - christian
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
26 //System.setProperty("http.proxyHost", "proxy.unibe.ch");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
27 //System.setProperty("http.proxyPort", "8080");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
28
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
29 if(htmlPage != null) {
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
30 response.getWriter().println(htmlPage);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
31 // neue parameterart eingebaut - christian
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
32 } else if(htmlURL != null) {
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
33 try {
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
34 URL u = new URL(htmlURL);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
35 String content_type = u.openConnection().getContentType();
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
36 InputStream is = u.openStream();
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
37 InputStreamReader isr = new InputStreamReader(is);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
38 BufferedReader br = new BufferedReader(isr);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
39 //response.setContentType(content_type);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
40 String aLine;
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
41 while ((aLine = br.readLine()) != null) {
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
42 response.getWriter().println(aLine);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
43 }
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
44 } catch (Exception e) {
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
45 response.getWriter().println(e);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
46 }
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
47 } else if((xmlURL != null) && (xslURL != null)) {
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
48 out.println("xsl");
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
49 response.sendRedirect("http://sophia.unibe.ch:8080/xslt/ApplyXSLT?URL="+ xmlURL + "&xslURL=" + xslURL);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
50 } else if(fileName != null && pageNumber != null) {
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
51 response.sendRedirect("http://hera.unibe.ch:8080/alcatraz/servlet/Texter?fn=" + fileName + "&pn=" + pageNumber);
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
52 }
cd013d3a0e55 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
53 %>