java获取文件的路径怎么写( 二 )


String filename =requeset.getParameter("filename");
if(filename==null){
out=response.getOutputStream();
out.write("please input filename.".getBytes());
out.close;
return;
}
//获得读取本地文件的输入流
in=getServletContext().getResourceAsStream("/store"+filename);
int length=in.available();
}