aspose file tools*
The moose likes Servlets and the fly likes Mixing content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Mixing content" Watch "Mixing content" New topic

Mixing content

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
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.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
<img src=""/>
You cannot mix a normal HTML page (and nothing else is the result of a JSP) with some binary content.
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Thank you!
I agree. Here's the link:
subject: Mixing content
Similar Threads
Fetching an image from the specified URL and resizing it.
urgent - display Image (binary) + html in single page
how to find the size of web page
Showing image from servlet
Problem running Servlet