VIEWSOURCE.jsp 716 Bytes
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<%
String realPath = request.getRealPath(request.getParameter("file"));
if (realPath == null)
	//some web servers have bugs and real path must be obtained as follows
    realPath = request.getRealPath(request.getContextPath() + request.getParameter("file"));
%>
<html>
<body topmargin="0" leftmargin="5" rightmargin="0" marginwidth="5" marginheight="0">
<p style="margin-bottom:5px"><font size="4" face="Verdana"><b><%=realPath%></b></font></p>
<a href="javascript:history.go(-1);"><font size="2" face="Verdana">Back to Chart Graphics</font></a>
<xmp><%
java.io.FileReader input = new java.io.FileReader(realPath);
int c;
while ((c = input.read()) != -1)
	out.write((char)c);
input.close();
%></xmp>
</body>
</html>