有个空对象错误!
看一下那个编译后的uploadOK.jsp 的第80行 ...

解决方案 »

  1.   

    对``把uploadOK.jsp 代码贴出来
      

  2.   

    可能是图片的路径错了。
    参看:http://blog.csdn.net/caoyinghui1986/archive/2008/04/05/2252772.aspx
      

  3.   

    UploadOK.jsp
    <%@ page contentType="text/html;charset=gb2312" language="java" import="java.sql.*,java.util.*,java.text.*,java.io.*" errorPage=""%>
    <jsp:useBean id="ISO2GB" scope="page" class="community.ISO2GB"/>
    <jsp:useBean id="JDBC" scope="page" class="community.JDBConnection"/>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>上传照片</title>
    </head><body bgcolor="#efefa3" ><%
    Connection conn=JDBC.connection();
    String id=request.getParameter("id");
    String filename=ISO2GB.convert(request.getParameter("photo"));FileInputStream str=new FileInputStream(filename);
    String sql="insert into photo(id,pic) values(?,?)";
    try
    {PreparedStatement pstmt=conn.prepareStatement(sql);
    pstmt.setString(1,id);
    pstmt.setBinaryStream(2,str,str.available());
    pstmt.execute();
    out.print("OK!");pstmt.close();
    conn.close();
    }catch(Exception e){e.toString();}%>
    </body>
    </html>