<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.io.*" %>
<%
String target=request.getParameter("target");
if(target==null){
    out.println("没有取到target参数");
    return;
}
if(!target.startsWith("/")){
    target="/"+target;
}
InputStream input=pageContext.getServletContext().getResourceAsStream(target);
if(input==null){
    out.println("文件没有找到");
    return;
}
byte[] buff=new byte[1024];
int len=-1;
pageContext.getResponse().getOutputStream().println("<html><body><textarea style='width:100%;height:100%'>");
while((len=input.read(buff,0,buff.length))>0){
    pageContext.getResponse().getOutputStream().write(buff,0,len);
}
pageContext.getResponse().getOutputStream().println("</textarea></body></html>");
pageContext.getResponse().getOutputStream().flush();
%>
