aspose file tools*
The moose likes Servlets and the fly likes HTML file... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTML file..." Watch "HTML file..." New topic
Author

HTML file...

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
how can i call html file in a servlet?
I want to read the html content stored in a file and want that as a servlet output. How should I do it?
Thanks
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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?
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Jairat,
I use it like this.

I responded to your another post of same question. Which approach are you going to take. This ,.include technique also would work.
regds
maha anna
 
 
subject: HTML file...