• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

embedding pdf or .png/.gif/.jpg in a JSP page

Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are currently using a object tag to display a pdf or .gif file.
There are some buttons around these object tag, like "back" button for navigation.

Hence the page have one url (url1) and object tag have (url 2).
url2 can point to a pdf or .png file.

When the page is rendered on a browser, the action initiating the url1 is part of the first http request to the server.
While the response to the first http request (url1) is rendered, the browser recognizes the object tag and issues a second get request to the server with url 2..

Question : Is there a way to accomplish this by just one http response? That is when the response for url1 is made, a byte stream of
image or pdf can be passed in the request and the browser can render the object tag from the first response itself.

Out of Scope for this discussion: Browser version. Browser version used is IE 8 and it supports object tag.

appreciate any response; If any other forums suite this discussion please feel free to move it there
Posts: 3036
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know you can base 64 encode an image, and put it directly into the HTML, like <img src="data:image/gif;base64,(data)" >

I believe IE8 supports that, but maybe only for smallish images. Other browsers, and maybe even IE9 and later, support it without the size restriction. I don't know if it also works in an object tag though.
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Greg

talks about the same which you mentioned. I will try with object tag
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic