Examples initial import.

This commit is contained in:
Erik C. Thauvin 2004-03-20 13:36:08 +00:00
parent ed19117078
commit 6ed79c0387
18 changed files with 1653 additions and 8 deletions

View file

@ -0,0 +1,25 @@
<%@page import="java.io.*"%>
<html>
<body>
<pre>
<%
String file = request.getParameter("file");
if ((file != null) && (file.trim().length() > 0) && (file.indexOf( ".." ) == -1)) {
InputStream is = pageContext.getServletContext().getResourceAsStream(file);
if (is != null) {
InputStreamReader isr = new InputStreamReader(is);
for (int ch = isr.read(); ch != -1; ch = isr.read()) {
if (ch == '<') {
out.print("&lt;");
} else if (ch == '\t') {
out.print(" ");
} else {
out.print((char) ch);
}
}
}
}
%>
</pre>
</body>
</html>