aspose 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
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply 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.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
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: 56547
    
  14

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: to get all required fields in single page
 
Similar Threads
Refresh chart in jsp according to MySQL database
error :java.lang.NullPointer Exception in searchuser.jsp page
Drop down box
Jfreechart display error on Chrome /firefox
error showing while retrieving the data from drop down list