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