Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

to get all required fields in single page  RSS feed

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had developed a application where there are three drop downs placed adjacent to each other . when i click a value from any drop down a image has been viewed . but the problem i am getting is that the image is viewed or opened in different page. i need to be get the image in the same page where the drop down is placed and if i click another image value from drop down i should get the drop down menu, the image of first one and the image of current one which i had clicked should be seen in same page . how can i do this?. The image i said is the image developed from Jfreechart.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try removing response.setContentType("image/png"); and use iframe for displaying the images..
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*cough*

Images in HTML are to be displayed using the <img> element.
The <img> element has a 'src' attribute which should point to a valid and public URL of the image.
If the images are to be generated, the URL should point to a some servlet which writes the image to the outputstream.
 
Aparna Raghavan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops sorry... images have <img> tag.... <iframe> is used for documents....

Aparna
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should add, scriptlets are in any way a sign of a bad practice.

Whenever you feel the need to write a scriptlet, immediately stop with it and rethink the design and approach. In most cases you can use taglibs (JSTL and so on) and/or EL to solve the coding issue. But in extreme (read: very poorly designed) cases you should be using a Java class for this. Such as this case, where in you should be using a Servlet class. Handling binary data using a view technology designed for handling character data makes absolutely no sense. It would only corrupt the binary data and vice versa.
 
Sheriff
Posts: 67259
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article to understand why Bauke's assertion that JSP is a poor technology choice for binary streaming is true.
 
I child proofed my house but they still get in. Distract them with this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!