我的jsp文件如下文件属性编码为utf-8
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.io.File.*"%>
<%@ page import="java.io.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="java.io.File;"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%!String dex; %>
<title>在线阅读</title>
</head>
<body>
<%
dex=request.getParameter("index");
out.println(session.getAttribute("authorList"+dex));%>
的论文如下:
<hr><br>
<%try
{String fileName="E:\\upload\\"+session.getAttribute("authorList"+dex).toString()+".doc";
File myFile=new File(fileName);
BufferedReader in = new BufferedReader(new FileReader(myFile));
String str;
while ((str = in.readLine()) != null)
{
%>
<%
//byte[] byte1=str.getBytes("utf-8");
//String outStr=new String(byte1,"UTF-8");
//str.getBytes("UTF-8");out.println(new String(byte1,"utf-8"));
response.setCharacterEncoding("UTF-8");
//out.println(outStr);
out.println(str);
%>
<%
}
in.close();
}
catch (IOException e)
{
e.getStackTrace();
}%>
</body>
</html>请高人指点,不知word文件的默认编码方式是什么?
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.io.File.*"%>
<%@ page import="java.io.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="java.io.File;"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%!String dex; %>
<title>在线阅读</title>
</head>
<body>
<%
dex=request.getParameter("index");
out.println(session.getAttribute("authorList"+dex));%>
的论文如下:
<hr><br>
<%try
{String fileName="E:\\upload\\"+session.getAttribute("authorList"+dex).toString()+".doc";
File myFile=new File(fileName);
BufferedReader in = new BufferedReader(new FileReader(myFile));
String str;
while ((str = in.readLine()) != null)
{
%>
<%
//byte[] byte1=str.getBytes("utf-8");
//String outStr=new String(byte1,"UTF-8");
//str.getBytes("UTF-8");out.println(new String(byte1,"utf-8"));
response.setCharacterEncoding("UTF-8");
//out.println(outStr);
out.println(str);
%>
<%
}
in.close();
}
catch (IOException e)
{
e.getStackTrace();
}%>
</body>
</html>请高人指点,不知word文件的默认编码方式是什么?
word 如果这么容易就被读出来,microsoft就太垃圾了!
我是刚接触他的(poi),还不太会用
怎样才能让他按照word文档的格式显示,并显示图片呢