2005-11-12 05:03:51 +00:00
|
|
|
<%
|
2009-05-19 18:07:19 +00:00
|
|
|
/*
|
|
|
|
* USE CAUTION WHEN EDITING
|
|
|
|
* Trailing whitespace OR NEWLINE on the last line will cause
|
|
|
|
* IllegalStateExceptions !!!
|
|
|
|
*/
|
|
|
|
|
2005-11-12 05:03:51 +00:00
|
|
|
String uri = request.getRequestURI();
|
|
|
|
if (uri.endsWith(".css")) {
|
|
|
|
response.setContentType("text/css");
|
|
|
|
} else if (uri.endsWith(".png")) {
|
|
|
|
response.setContentType("image/png");
|
|
|
|
} else if (uri.endsWith(".gif")) {
|
|
|
|
response.setContentType("image/gif");
|
|
|
|
} else if (uri.endsWith(".jpg")) {
|
|
|
|
response.setContentType("image/jpeg");
|
2009-06-28 12:50:33 +00:00
|
|
|
} else if (uri.endsWith(".ico")) {
|
|
|
|
response.setContentType("image/x-icon");
|
2005-11-12 05:03:51 +00:00
|
|
|
}
|
2009-06-28 12:50:33 +00:00
|
|
|
response.setHeader("Cache-Control", "max-age=86400"); // cache for a day
|
2005-11-12 05:03:51 +00:00
|
|
|
net.i2p.util.FileUtil.readFile(uri, "./docs", response.getOutputStream());
|
|
|
|
%>
|