How can I mix content using servlet, i.e. I wan to generate a page containing ordinary HTML tags as well as dinamicly created JPG image. I don't want to store image on server's file system. It must be sent on the fly with HTML code.
The only way of achiving this is to provide a servlet which generates the binary stream for an image. Then your jsp would just call the servlet in its image tag e.g. <img src="http://myhost.com/myapp/imgservlet"/> You cannot mix a normal HTML page (and nothing else is the result of a JSP) with some binary content.