annotate client/digitallibrary/contexto/contexto.jsp @ 238:1ccda61967b2

initial parameter parsing now earlier
author robcast
date Tue, 20 Jul 2004 15:29:25 +0200
parents 27591a0dceb1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
227
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
1 <%@ page language="java" %>
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
2 <%@ page import="java.io.*" %>
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
3 <%@ page import="java.net.*" %>
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
4
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
5 <%
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
6 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
7 dlRequest.setWithRequest(request);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
8
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
9 %>
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
10
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
11 <%
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
12 // Possible parameters
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
13 String htmlPage = request.getParameter("htmlPage");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
14 // neu eingebaut - christian
27591a0dceb1 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
27591a0dceb1 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
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
17 // kontrollmechanismen hat, aber im moment halt meinen anspruechen
27591a0dceb1 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)
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
19 String htmlURL = request.getParameter("htmlURL");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
20 String xmlURL = request.getParameter("xmlURL");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
21 String xslURL = request.getParameter("xslURL");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
22 String fileName = request.getParameter("fn");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
23 String pageNumber = request.getParameter("pn");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
24
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
25 // funcktioniert leider nicht - christian
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
26 //System.setProperty("http.proxyHost", "proxy.unibe.ch");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
27 //System.setProperty("http.proxyPort", "8080");
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
28
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
29 if(htmlPage != null) {
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
30 response.getWriter().println(htmlPage);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
31 // neue parameterart eingebaut - christian
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
32 } else if(htmlURL != null) {
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
33 try {
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
34 URL u = new URL(htmlURL);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
35 String content_type = u.openConnection().getContentType();
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
36 InputStream is = u.openStream();
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
37 InputStreamReader isr = new InputStreamReader(is);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
38 BufferedReader br = new BufferedReader(isr);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
39 //response.setContentType(content_type);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
40 String aLine;
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
41 while ((aLine = br.readLine()) != null) {
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
42 response.getWriter().println(aLine);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
43 }
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
44 } catch (Exception e) {
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
45 response.getWriter().println(e);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
46 }
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
47 } else if((xmlURL != null) && (xslURL != null)) {
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
48 out.println("xsl");
27591a0dceb1 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);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
50 } else if(fileName != null && pageNumber != null) {
27591a0dceb1 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);
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
52 }
27591a0dceb1 new versions on modules and contexto tool to show text
luginbue
parents:
diff changeset
53 %>