S
Steve R. Burrus
I posted this problem to the group the other nite, but alas, since it still
persists as a problem for me, I thought that i would re-submit it for anyone
to try to help me with it. The problem is still getting a server error
pointing to a "NullPointerException"!!! I really don't see at all any kind
of a null object reference or any problem like that could lead to such an
exception in this file :
package org.my.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class My_Image extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("image/jpeg");
ServletContext con = getServletContext();
InputStream in = con.getResourceAsStream("/MyBeautifulGirl1.jpeg");
int read = 0;
byte[] bytes = new byte[1024];
OutputStream os = resp.getOutputStream() ;
while(( read = in.read(bytes)) != -1){
os.write(bytes, 0, read);
}
os.flush();
os.close();
}
}
persists as a problem for me, I thought that i would re-submit it for anyone
to try to help me with it. The problem is still getting a server error
pointing to a "NullPointerException"!!! I really don't see at all any kind
of a null object reference or any problem like that could lead to such an
exception in this file :
package org.my.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class My_Image extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("image/jpeg");
ServletContext con = getServletContext();
InputStream in = con.getResourceAsStream("/MyBeautifulGirl1.jpeg");
int read = 0;
byte[] bytes = new byte[1024];
OutputStream os = resp.getOutputStream() ;
while(( read = in.read(bytes)) != -1){
os.write(bytes, 0, read);
}
os.flush();
os.close();
}
}