I have an index.html file in my local disk file system on c:\report\index.html. I need to display this file in web application’s JSP page in an <iframe>.
How can I achieve this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create a servlet which gets an
InputStreamof it with help ofFileInputStreamand writes it to theOutputStreamof the response after having set the proper content type header (so that the browser understands how to deal with it). Finally just specify the URL of the servlet in the<iframe src>.E.g.
with
An alternative is to map
c:/reportas a new webapp context in your server configuration so that you can just access it directly by http://example.com/report/index.html.