• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to get all required fields in single page

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic