Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

load two images for one request  RSS feed

 
venugopal NS
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi My requirements are as below

html page
----------

dynamic fields

// Image is dynamic

dynamic fields

// Image is dynamic


Servlet
------
I make a call to web service
web service which takes the Checknumber and returns two byte arrays (I.e. I will get both byte arrays in one call )
frontCheckbytes[]
backCheckbytes[]
in html page I need to display front and back check images
what my problem is for front image I need to make web service call again for back Image I need to make a call again in order to write into the stream even though my service returns both portions on one request.
is it possible to acheive this(boty images display dynamically on html page) with a single request.


Please provide your valuable response
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember that a JSP is merely a template for an HTML page. So you do things the same way as HTML, and in HTML you don;t deal with byte streams, do you?

Rather, use <img> tags, and have the URLs of those tags reference the resources that return the image data as their responses.
 
venugopal NS
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but my issues is from web services I will get Image response as streams. in one call I will get two byte arrays i.e. for two images. Is it possible to load two dynamic Images(this images are streams) with single request?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check your private messages for an important administrative matter. Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
venugopal NS wrote:but my issues is from web services I will get Image response as streams. in one call I will get two byte arrays i.e. for two images. Is it possible to load two dynamic Images(this images are streams) with single request?

Nope.

You'd have to figure out a way to store the streams individually and then address them with img tags. Why not just get the web service fixed?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!