This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Servlet generating Image into Browser's Popup Window  RSS feed

 
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
 
Author and all-around good cowpoke
Rancher
Posts: 13078
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
 
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!