posts - 35,  comments - 6,  trackbacks - 0
jsp
1  <IMG width="200" height="200" border="0"    style="cursor: pointer;"    
2           src="<%=request.getContextPath()%>/xxxx.do?type=show&pkId=xx">


action.do

 1 if(type.equals("show"))
 2             {
 3                 InputStream inputsteam = null;
 4              Long     pkId=Long.parseLong(servletRequest.getParameter("pkId"));
 5                  if (pkId != null&&!pkId.equals(""))
 6                     {
 7                         inputsteam = bpo.getBlobByID(pkId).getBinaryStream();
 8 
 9                   
10                     BufferedImage image = ImageIO.read(inputsteam);
11                     ServletOutputStream sos = servletResponse.getOutputStream();
12                     JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
13                     encoder.encode(image);
14                     inputsteam.close();
15                   
16                     }
17                   return null;
18             }
19 
posted on 2007-05-05 23:20 NG 阅读(486) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
<2007年5月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

常用链接

留言簿(1)

随笔档案(35)

文章分类(5)

文章档案(2)

新闻档案(5)

java link

搜索

  •  

最新评论

阅读排行榜

评论排行榜