%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="java.io.OutputStream"%>
<%@page import="java.io.InputStream"%>
<%@page import="java.net.URL"%>
<%@page import="java.awt.image.BufferedImage"%>
<%@page import="java.awt.Graphics2D"%>
<%@page import="javax.imageio.ImageIO"%>
<%@page import="java.util.Arrays"%>
<%@page import="java.util.Comparator"%>
<%@page import="java.util.Enumeration"%>
<%
String location=request.getParameter("l");
final String sinaiticusBaseURL = "http://www.codex-sinaiticus.net/handler/transcription.ashx";
if (location == null) return;
if (location.equalsIgnoreCase("s")) {
String f=request.getParameter("f");
String q=request.getParameter("q");
String s=request.getParameter("s");
location = sinaiticusBaseURL+"?f="+f+"&q="+q+"&s="+s;
}
try {
URL l = new URL(location);
InputStream i = l.openStream();
OutputStream o = response.getOutputStream();
while (true) {
int data = i.read();
if (data == -1) break;
o.write(data);
}
i.close();
o.close();
}
catch (Exception e) {e.printStackTrace();}
%>