JSP directly generate word

Category: Java EE
 
a7091
2010-07-23 03:25:53

Sponsored Links
<% @ Page language = "java" import = "java.io. *" pageEncoding = "UTF-8"%>
<% @ page contentType = "application / msword; charset = gb2312"%>

<%
String path = request.getContextPath ();
String basePath = request.getScheme () + ":/ /" + request.getServerName () + ":" + request.getServerPort () + path + "/";
File file = new File ("E: \ \ work \ \ 1.doc");
out.println (file);
; out.close ();
%>

this code to access the page will appear a download case, how can the The JSP page is displayed directly on the word content

Sponsored Links

Niyee
2010-07-23 03:31:02
how is this problem.
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.