用servlet将jsp文件内容转为html。代码如下:
package examples;
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 { private static final String CONTENT_TYPE = "text/html; charset=GBK"; // Initialize global variables public void init() throws ServletException { } // Process the HTTP Get request public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletExceptio