<%@ page contentType="text/html; charset=UTF-8"
%><%@ page import="java.util.*"
%><%@ page import="java.io.*"
%><%


String ls_photo = request.getParameter("ls_photo");
if(ls_photo==null || ls_photo.toUpperCase().indexOf("D:")==-1 || ls_photo.indexOf("Tomcat6_mis/webapps")==-1 || ls_photo.lastIndexOf(".gif")==-1){
	response.getWriter().write("无效的URL");
	response.flushBuffer();
	return;
}
//图片文件写入到response
	byte[] buffer = new byte[1024];
	InputStream is = null;
	try{
	if((ls_photo!=null && ls_photo!="") && ls_photo.trim().length()>0){
		is = new FileInputStream(ls_photo);	
	}else{
	    is = new FileInputStream("E:/eclipse3.2.1/MyEclipse 9/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/gaowj/images/hsdata/nophoto.gif");
	}
	while (is.read(buffer) >= 0) {
		response.getOutputStream().write(buffer);
	}
	}catch(Exception e){
	      is = new FileInputStream("E:/eclipse3.2.1/MyEclipse 9/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/gaowj/images/hsdata/nophoto.gif");
	      while (is.read(buffer) >= 0) {
		        response.getOutputStream().write(buffer);
	      }
		  System.out.println("找不到图片");
		}
	response.flushBuffer();
%>