帮我解决了,狂给分呀,高手快来吧 DataBaseBean.ConnPool.MyFun是一个包还是一个class? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 包名怎么还有大写字母?好几年前就不推荐用大写字母了问题可能出在MyFun那里,你把stacktrace贴全了,别光贴一个exception message,然后大家再看看 public static void downloadFile(String SqlStr, String imgfieldstr) { Connection conn = getConnection(); PreparedStatement temppstmt = null; ResultSet rs = null; try { temppstmt = conn.prepareStatement(SqlStr); rs = temppstmt.executeQuery(); if(rs.next()) { InputStream in = rs.getBinaryStream(imgfieldstr); m_response.reset(); m_response.setContentType("image/jpeg"); byte b[] = new byte[1024]; int i; while((i = in.read(b)) > 0) m_response.getOutputStream().write(b, 0, i); in.close(); } rs.close(); temppstmt.close(); } catch(Exception e) { System.out.println(e); } m_response输出"image/jpeg"之后,你可能又输出文本了,比如调用了out.print之类的这种图片建议专门有一个servlet去做,然后再jsp里面include它 <%@ page import="DataBaseBean.ConnPool.MyFun"%>你这样只是引用 建议你还不如写 useBean 或者试下<%@ page language="java" import="DataBaseBean.ConnPool.MyFun"%> according the error message, maybe the error was occured in this<%@ page import="DataBaseBean.ConnPool.MyFun"%> Java 截取字符串问题 Eclipse进行web开发有什么好用的插件? 关于excel文件打开、下载的问题 关于动态刷新jsp页面 100分求解问题!~~~ 怎样在http头部中设定和获得版本信息? 急!怎样在网页中让select下拉列表框不仅具有录入功能而且也可以选择功能? EVAL_BODY_TAG的问题 超级菜鸟的高分问题 用JAVAMAIL如何发送HTML代码? 如何将jsp页面下显示的数据库内容中某个记录的字段传递到另外一张jsp页面! 请问用下拉菜单的什么属性改变下拉菜单的宽度?
问题可能出在MyFun那里,你把stacktrace贴全了,别光贴一个exception message,然后大家再看看
{
Connection conn = getConnection();
PreparedStatement temppstmt = null;
ResultSet rs = null;
try
{
temppstmt = conn.prepareStatement(SqlStr);
rs = temppstmt.executeQuery();
if(rs.next())
{
InputStream in = rs.getBinaryStream(imgfieldstr);
m_response.reset();
m_response.setContentType("image/jpeg");
byte b[] = new byte[1024];
int i;
while((i = in.read(b)) > 0)
m_response.getOutputStream().write(b, 0, i);
in.close();
}
rs.close();
temppstmt.close();
}
catch(Exception e)
{
System.out.println(e);
}
这种图片建议专门有一个servlet去做,然后再jsp里面include它
你这样只是引用 建议你还不如写 useBean
或者试下
<%@ page language="java" import="DataBaseBean.ConnPool.MyFun"%>
<%@ page import="DataBaseBean.ConnPool.MyFun"%>