This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Displaying a HTML file in the new Browser Window using JSP
Desai Sandeep
Ranch Hand
Joined: Apr 02, 2001
Posts: 1157
posted
0
Hi, I require to have a JSP page, which would be able to display an HTML file in another browser window.This JSP page would be able to access the HTML files of the system, which may not necessarily be mapped to the same web server. Hence I need to:
Access the path information of the file
Read the File through InputStreams
Write it using the Outputstream in the new Browser window
We may consider click of a link of a file which would get the file information and display it in a new Browser window Is this possible through JSP? Thanks in advance. Regards, ------------------ Sandeep Desai vgdesai@bom3.vsnl.net.in
Sun Certified Java ProgrammerScored 93 per cent
Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
IBM Enterprise Connectivity with J2EE Scored 72 per cent
Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
Ashwin Desai
Ranch Hand
Joined: Jul 17, 2000
Posts: 124
posted
0
Hi, One of the simplest ways would be to Read the file and write it out to a web-accessible location. Then spawn a new window (using javascript) pointing to this location. Alternatively, you will have to use a Jsp page (/servlet) exclusively for the {read file, write file to outstream} Jsp #1 or even a static HTML page (depends on your needs)
filewriter.jsp
But, the above method needs 2 requests to the server. One for getting the main page (jsp/html) and the other to load the content in a new browser window. Hope this helps. Ashwin. [This message has been edited by Ashwin Desai (edited April 27, 2001).]
Desai Sandeep
Ranch Hand
Joined: Apr 02, 2001
Posts: 1157
posted
0
Hi Ashwin, Is there any way we can open a new browser window through JSP? Thank you for your views. Regards,
Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
IBM Enterprise Connectivity with J2EE Scored 72 per cent
Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
Andrew Shafer
Ranch Hand
Joined: Jan 19, 2001
Posts: 338
posted
0
The answer is yes and no. Opening a new browser is something that takes place entirely on the client. This is the realm of JavaScripting. JSP can dynamically generate Javascript (or pretty much anything) and this scripting can open a new window.
!_I_Know_Kung_Fu_!
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: Displaying a HTML file in the new Browser Window using JSP