10-02
04
百度贴吧图片跳转(JSP版)
作者:Java伴侣 日期:2010-02-04
<%
if(request.getHeader("")!=null&&request.getHeader("").indexOf("baidu")!=-1){
String url = "http://baidu.com";
response.sendRedirect(url);
}
else{
File myGifFile = new File(request.getRealPath("")+"/logo.jpg");
BufferedImage bufi = ImageIO.read(myGifFile);
response.reset();
response.setContentType("image/jpeg");
ImageIO.write(bufi, "jpeg", response.getOutputStream());
}
%>
if(request.getHeader("")!=null&&request.getHeader("").indexOf("baidu")!=-1){
String url = "http://baidu.com";
response.sendRedirect(url);
}
else{
File myGifFile = new File(request.getRealPath("")+"/logo.jpg");
BufferedImage bufi = ImageIO.read(myGifFile);
response.reset();
response.setContentType("image/jpeg");
ImageIO.write(bufi, "jpeg", response.getOutputStream());
}
%>
评论: 0 | 引用: 0 | 查看次数: 244
发表评论