Mercurial > hg > digilib-old
comparison client/digitallibrary/contexto/contexto.jsp @ 227:27591a0dceb1
new versions on modules and contexto tool to show text
author | luginbue |
---|---|
date | Fri, 09 Jul 2004 02:39:46 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
226:88f2de6b518a | 227:27591a0dceb1 |
---|---|
1 <%@ page language="java" %> | |
2 <%@ page import="java.io.*" %> | |
3 <%@ page import="java.net.*" %> | |
4 | |
5 <% | |
6 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(); | |
7 dlRequest.setWithRequest(request); | |
8 | |
9 %> | |
10 | |
11 <% | |
12 // Possible parameters | |
13 String htmlPage = request.getParameter("htmlPage"); | |
14 // neu eingebaut - christian | |
15 // @beat: kannst du das zeugs bitte checken und mir sagen, ob du | |
16 // dagegen bist oder nicht. es ist ein uebler hack, der keine | |
17 // kontrollmechanismen hat, aber im moment halt meinen anspruechen | |
18 // genuegt. (den import von java.net.* ist auch von mir) | |
19 String htmlURL = request.getParameter("htmlURL"); | |
20 String xmlURL = request.getParameter("xmlURL"); | |
21 String xslURL = request.getParameter("xslURL"); | |
22 String fileName = request.getParameter("fn"); | |
23 String pageNumber = request.getParameter("pn"); | |
24 | |
25 // funcktioniert leider nicht - christian | |
26 //System.setProperty("http.proxyHost", "proxy.unibe.ch"); | |
27 //System.setProperty("http.proxyPort", "8080"); | |
28 | |
29 if(htmlPage != null) { | |
30 response.getWriter().println(htmlPage); | |
31 // neue parameterart eingebaut - christian | |
32 } else if(htmlURL != null) { | |
33 try { | |
34 URL u = new URL(htmlURL); | |
35 String content_type = u.openConnection().getContentType(); | |
36 InputStream is = u.openStream(); | |
37 InputStreamReader isr = new InputStreamReader(is); | |
38 BufferedReader br = new BufferedReader(isr); | |
39 //response.setContentType(content_type); | |
40 String aLine; | |
41 while ((aLine = br.readLine()) != null) { | |
42 response.getWriter().println(aLine); | |
43 } | |
44 } catch (Exception e) { | |
45 response.getWriter().println(e); | |
46 } | |
47 } else if((xmlURL != null) && (xslURL != null)) { | |
48 out.println("xsl"); | |
49 response.sendRedirect("http://sophia.unibe.ch:8080/xslt/ApplyXSLT?URL="+ xmlURL + "&xslURL=" + xslURL); | |
50 } else if(fileName != null && pageNumber != null) { | |
51 response.sendRedirect("http://hera.unibe.ch:8080/alcatraz/servlet/Texter?fn=" + fileName + "&pn=" + pageNumber); | |
52 } | |
53 %> |