JSP implementation from the server download XLS file to the client method _jsp programming

Source: Internet
Author: User

This article describes the JSP implementation from the server download XLS file to the client method. Share to everyone for your reference, specific as follows:

Reference to the code on the Internet to write a download xls file to the client's JSP page, as long as the server's file address to the JSP page can be implemented to download files to the client.

<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%> <%@ taglib prefix= "C" uri= "http://" Java.sun.com/jsp/jstl/core "%> <%@ page import=" java.io.* "%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  
<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%> <%@ taglib prefix= "C" uri= "http://" Java.sun.com/jsp/jstl/core "%> <%@ page import=" java.io.* "%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

2. Another modified version (download file name can contain Chinese)

<%@ page language= "java" import= "java.util.*,java.net.*" pageencoding= "Utf-8"%> <%@ taglib prefix= "C" uri= " Http://java.sun.com/jsp/jstl/core "%> <%@ page import=" java.io.* "%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <meta http-equiv=" content-type "content=" text/html; Charset=utf-8 ">  

I hope this article will help you with JSP programming.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.