Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

open .txt file using WORDPAD instead of Notepad?

843841Apr 10 2003 — edited Apr 10 2003
Here is the code I wrote. How can I force my servlet to open the .txt file from the word pad?
urlPdf="/reports/F"+selectMonth+selectYear+alcCode+".txt"; 
   

    res.reset();
    res.resetBuffer();
    res.setContentType("text/plain");//?????
   
   res.setHeader("Content-disposition","attachment; filename" +urlPdf );
   res.setHeader("Cache-Control","no-cache"); //HTTP 1.1
   res.setHeader("Pragma","no-cache"); //HTTP 1.0
 try{
    ServletContext sc = getServletContext();
    RequestDispatcher rd = sc.getRequestDispatcher(urlPdf);
    rd.forward(req, res);
[\code]

Thanks in advance.
-Sreekanth Varidhireddy
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2003
Added on Apr 10 2003
1 comment
177 views