File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes to get all required fields in single page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "to get all required fields in single page" Watch "to get all required fields in single page" New topic
Author

to get all required fields in single page

shyamkumar bopannachengalaiah
Ranch Hand

Joined: Dec 30, 2008
Posts: 100
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.

Aparna Raghavan
Greenhorn

Joined: Dec 07, 2008
Posts: 9
try removing response.setContentType("image/png"); and use iframe for displaying the images..
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
*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

Joined: Dec 07, 2008
Posts: 9
oops sorry... images have <img> tag.... <iframe> is used for documents....

Aparna
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Please read this article to understand why Bauke's assertion that JSP is a poor technology choice for binary streaming is true.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: to get all required fields in single page