jsp 如何实现下载文件的功能 第一步:创建 Servlet 第二步:写代码 public class FielDownLoad extends HttpServlet { /** * Constructor of the object
*/ public FielDownLoad() { super(); } /** * Destruction of the servlet
*/ public void destroy() { super
destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doGet method of the servlet
* * This method is called when a form has its tag value method equals to get
* * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * The doPost met