I tried a lot but all in vain. I am not able to to display image from servlet into jsp.
I have developed a servlet which in turn calls another class that returns BufferedImage.
In servlet I written:
PngEncoder png =new PngEncoder(image,false,0,9);
response.getOutputStream().write(png.pngEncode());
response.getOutputStream().close();
And in jsp I have written:
IMG src="/WebApplication5/ChartServlet"
but when i run my web application nothing gets displayed.
When i directly browse by this url
http://localhost:8080/WebApplication5/ChartServlet
it showing :
HTTP Status 500 - type Exception report message descriptionThe server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.NullPointerException note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1 logs. Sun Java System Application Server 9.1
What am I doing wrong?