aspose file tools*
The moose likes Servlets and the fly likes Servlet generating Image into Browser's Popup Window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet generating Image into Browser Watch "Servlet generating Image into Browser New topic
Author

Servlet generating Image into Browser's Popup Window

Mic Miccon
Greenhorn

Joined: Jul 01, 2010
Posts: 2
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

Joined: Mar 22, 2000
Posts: 12835
    
    5
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

Joined: Jun 07, 2010
Posts: 129

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.....

VIJINDAS
Mic Miccon
Greenhorn

Joined: Jul 01, 2010
Posts: 2
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet generating Image into Browser's Popup Window