Well i can not load image i have puted in the images folder.gives null pointer exception
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.net.*;
public class SetCookie extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException, ServletException
{
res.setContentType("image/gif");
ServletOutputStream sop=res.getOutputStream();
System.out.println(getServletContext().getResourceAsStream("c:/tomcat2/webapps/examples/images/code.gif"));
int ival=is.read();
while(ival!=-1)
{
sop.write(ival);
ival=is.read();
}
}
}