If you want to get all the contents of the HTML file, why not just use the include() method in the RequestDispatcher interface? Is there something you are trying to gain by reading the file in and writing it back out?
I want to get the contents of the file (which is a part of the HTML file, that was generated by parsing the XML document) and redirect to the brower. ie out.println("<html>"); out.println("<body>"); : : //here read the contents of the file.html, which contains a html //table, redirect that content to the browser : : out.println("</body>"); out.println("</html>");
I tried, response.sendRedirect("c:\file.html"); It is just displaying the contents of file but not the other html tags which I have written before and after I read the file. How do you use RequestDispatcher, please give me some pointers... Thanks