F
finecur
Here is my servlet:
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException{
response.setContentType("application/vnd.ms-excel");
response.addHeader("Pragma", "no-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader ("Expires", 0);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<table border=1>");
out.println("<tr>");
out.println("<th>A</th>");
out.println("<th>B</th>");
out.println("</table>");
out.println("</body>");
out.println("</html>");
}
When I call it from http://www.mydomain.com/myservlet.do?mypara=1 in
IE 7, it says
"Do you want to open or save this file?
Name:myservlet_do?mypara=1
Type:Microsoft Ecel Worksheet, 733
Form:www.mydomain.com
"
Then I click "Open",
but it says" Can not open the file", and the IE page went black.
Does anyone know why?
Thanks,
ff
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException{
response.setContentType("application/vnd.ms-excel");
response.addHeader("Pragma", "no-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader ("Expires", 0);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<table border=1>");
out.println("<tr>");
out.println("<th>A</th>");
out.println("<th>B</th>");
out.println("</table>");
out.println("</body>");
out.println("</html>");
}
When I call it from http://www.mydomain.com/myservlet.do?mypara=1 in
IE 7, it says
"Do you want to open or save this file?
Name:myservlet_do?mypara=1
Type:Microsoft Ecel Worksheet, 733
Form:www.mydomain.com
"
Then I click "Open",
but it says" Can not open the file", and the IE page went black.
Does anyone know why?
Thanks,
ff