Hi,
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class
test extends HttpServlet{
public void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException{
res.setContentType("application/msword");
//Get an output stream
PrintWriter out = res.getWriter();
//Construct an HTML page to return to the client
out.println("<HTML>");
out.println("<HEAD><TITLE=Test</TITLE></HEAD>");
out.println("<BODY>");
out.println("<h1 align=\"center\">"
+"<font color=\"#FF0000\">");
out.println("Hello World");
out.println("</font></h1>");
out.println("</BODY></HTML>");
out.println("hello");
}//end doGet()
}//end class Servlet01
When I tried to run this code. It opens in msword format, but without any result in that like Hello world. Why is it so. Can anyone explain where I might have gone wrong.
Thanks
Arathi