Mainly added to the JSP page
Response. setheader ("content-disposition ","Attachment; filename=shouexcel.xls ");%>
The complete page is as follows:
Response. setheader ("content-disposition ","Attachment; filename=shouexcel.xls ");%>
export
After a long time, I forgot the basics. Let's take a look at it today. Hehah... learn new things with a warm understanding !!!
1. requestdispatcher. Forward ()-forwardIs used on the server. When forward () is used, the servlet engine transmits
Response in JSP. sendredirect () and request. getrequestdispatcher (). both the forward (request, response) objects can redirect pages, but there is a big difference between the two objects. In terms of separation, there are the following
Java Servlet programming can easily send HTML files to the client's Web browser. However, many sites also allow access to documents in non-HTML format, including Adobe PDF, Microsoft Word, and micorsoft excel. In fact, as long as these non-HTML
Based on springmvc, This article uses the annotation method to explain the examples from configuration to simple common functions. The functions have been tested on the local machine and can run.
References: iteye blog;
Spring document;
1. Import
Today, I added a file upload function for my senior friend and found information on the Internet. struts1 supports file upload very well and is very convenient to use. In this example, you can easily upload files.
The attribute is org. Apache.
Article Source: http://www.blogjava.net/freeman1984/archive/2010/06/01/322465.html
Source:Http://blog.csdn.net/yzhz
I. Problems:The coding problem is that Java beginners often encounter problems during web development. There are also a large
Tomcat webapps to create a directory validate, build a WEB-INF Directory, which creates a web. xml file, the Code does not need to be written, there is a statement on the line: Web. xml:
Xmlns = "http://java.sun.com/xml/ns/j2ee"
Xmlns: xsi = "http:/
SummaryIn a password-protected web application, it is not only necessary to call the invalidate () method of httpsession to correctly handle the user exit process. Now most browsers have buttons for moving back and forward, allowing
HTTP header OverviewHypertexttransferprotocol is short for Hypertext Transfer Protocol. It is used to transmit WWW Data. For details about HTTP, see rfc2616.The HTTP protocol uses the request/response model.The client sends a request to the server.
1. Introduction to built-in objects
JSP built-in objects are very important in JSP. These built-in objects are created by WEB containers, so you do not need to create them yourself.
The main built-in objects include:
(1) request: javax. servlet.
React + ajax + java allows you to upload images and preview images.
In the past, I used ajax to upload images on the Internet. Most people wrote jQuery, but JQuery was used here, so I wrote it myself first.
First, click the selected file above.
In the web-OA system, document management seems indispensable. Sometimes some data needs to be queried from the database and output in a certain format and displayed as Word documents, sometimes Many Word documents are saved to the Blob field of a
1. getoutputstream () appears in JSP of tomcat5 () cause and solution of has already been called for this response exception: this error occurs in JSP under Tomcat 5. The output stream is usually used in JSP (for example, the output image
There are about three redirect Methods Using JSP:1. response. sendRedirect ();2. response. setHeader ("Location ","");3.
The following rules are obtained after testing:
I. response. sendRedirect ()
Out. flush () is not allowed before this statement.
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.