• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Greg

http://www.websiteoptimization.com/speed/tweak/inline-images/
talks about the same which you mentioned. I will try with object tag
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic