Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet generating Image into Browser's Popup Window

 
Mic Miccon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I haven't coded with Java for a while but now I'm happy to do it.
I have situation that Servlet is generating dynamically a Graphic into MemoryStream and it should be shown
in a new Popup Window of the Browser. I also have to give some properties to Popup Window show I can't use <a href's > target="_blank" attribute.
If Servlet generating a Craphic is called using a img-tag so how should I do it that Graphic comes to a new Popup Window?

Can javascript handle that or if yes how?

Scenario is following: User is selecting a wanted Image from JSP's list, selected item calls Popup Window and Servlet is generating Graphic into it.

I would be glad for some advise,

Cheers

Mic
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not work out the problem in two steps:

1. Figure out the HTML and Javascript to create a popup window with a static image from a file.
2. with that working direct the image request to a servlet with a URL that ensures you get the right image. Remember to set the content-length and mime type in the servlet response.

Bill
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when User is selecting a wanted Image from JSP's list call a java script function
inside that function give a particular name to your selected file and add that value as url parameter
like myservlet?filename="myfilename" then open new window using
window.open(myservlet?filename="myfilename");

check this link for more info on that javascript method

hope this will work for you.....
 
Mic Miccon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vijin das wrote:when User is selecting a wanted Image from JSP's list call a java script function
inside that function give a particular name to your selected file and add that value as url parameter
like myservlet?filename="myfilename" then open new window using
window.open(myservlet?filename="myfilename");

check this link for more info on that javascript method

hope this will work for you.....


Thanks a lot, this was what I was looking for,

Br
Mic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic