生成的静态页面是乱码??
这是在网上找到的,生成静态页面的代码,只是生成的静态页面全是乱码?请高手指教!
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import
java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import
javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
public class toHtml extends HttpServlet
{
public void service(HttpServletRequest request, HttpServletResponse response) throws
ServletException,
IOException {
String url= " ";
String name= " ";
ServletContext sc = getServletContext();
String file_name=request.getParameter( "file_name ");//你要访问的jsp文件,如index.jsp
//则你访问这个servlet时加参数.如http://localhost/toHtml?file_name=index
&nb