文件头上加
<%@ page contentType="application/msword" %>tomcat/conf/web.xml加:
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<%@ page contentType="application/msword" %>tomcat/conf/web.xml加:
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
><%@ page contentType="application/msword" %>不可能吧, 他的target 就是一個doc, 沒有文件头,
直接用response.setContentType()
<%@ page contentType="application/msword" %>
亦是可行的但如果有exception 時, contentType="application/msword" 就不适用了