Generally at the beginning of each page, add:
pageencoding= "UTF-8"%>
Request.setcharacterencoding ("UTF-8");%>
The role of Charset=utf-8 is to specify that the JSP output to the client is encoded as "UTF-8"
Pageencoding= "UTF-8" in order for
First thing, from the online next POI package and then import to MyEclipse.
And then the code:
Public ActionResult Excelprint () {Hssfworkbook workbook = new Hssfworkbook ();//Create an Excel file Hssfsheet sheet = Workbook.createsheet ()///Create
I. Overview
In Web applications, the generation of some reports may take a long time to compute, and some sites provide weather information that requires access to remote servers for SOAP calls to get temperature information. All of these are
The method of Excel reporting, one that is too simple, one that can only be used on window platforms (because of the use of Jdbc-odbc Bridge), and cannot use various formulas or methods within Excel, so today we introduce an Apache component called
1. Demo traditional Custom Label (jsp2.0 previous)
use a custom label to control whether the page content (label body) is output, using the return value of doStartTag () to control
return this. Skip_body; Ignore label body
return this.
Declare the DOCTYPE that suit your needs.
Looking at the original code, you can see that the first line is:
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
Open some of the standard sites, such as the famous web design software developer
One, the need for MVC
Separates the code that creates and operates data from the code that expresses the data. JSP separates most of the performance content from the dynamic content. And the servlet handles business logic.The servlet is responsible
JAVA SERVER PAGE
The JSP itself is a servlet, so it has all the benefits of a servlet.
The JSP is converted to a servlet the first time the JSP is accessed.Extends Httpjspbaseand compile it into. class.
Jsp:Good performancePlatform IndependentTag
JSP is the essence of the servlet, the developer's JSP file will be compiled by the Web container into the corresponding servlet, when the servlet is running in the container, the creation and destruction of its instance is not determined by the
One, JSP page display garbled
The following display page (display.jsp) will appear garbled:
JSP's Chinese processing
Out.print ("Chinese Processing of JSP");
%>
For different Web servers and different JDK versions, the processing results
The servlet can access objects such as Servletcontext,servletrequest and Servletresponse provided by the servlet container.
So how do you access these objects in the JSP ? For JSPs, these objects are called built-in objects or suppressed objects,
Briefly summarize:
Method= "Get",
String Output=new string (name.getbytes ("iso-8859-1"), "UTF-8");
%>
Method= "Post",
String name=request.getparameter ("name");
Here's how it works:
First, talk about the role of several encodings in Jsp/servlet.
One, Page object
The Page object represents the JSP itself, or rather, it represents the JSP-translated servlet, which can invoke the method defined by the Servlet class.
Two, config object
The Config object holds some of the servlet's initial data
Before the example has been written, because the time relationship has not been released, this time to bring about the Taglib in the basic functions have been introduced, in taglib we found that there is a tag called this brief introduction tags
Read the properties file in the JSP and set the value to the JS variable:
Web_stderr.properties file contents: [XHTML] view plain copy common.username.error.null = username can is not null. Common.username.error.invalid = Username is invalid.
Eight, Simpletagsupport class
After JSP2.0, in order to simplify the difficulty of label development, you can use simpletagsupport for development;
1. Developing generic labels
Note the point:
(1) need to inherit Simpletagsupport class;
(2)
Many Web sites are articles or other types of content of the paging effect, beginners for pagination development will sometimes only use code, but not in-depth understanding of code before the business logic structure, master this, I think, any
OUT.PRINTLN () output to the client.
In Out.println (), out is an instance of response, which is output by response as an object, outputting content to the client. If you use SYSTEM.OUT.PRINTLN () in a JSP page, only one space is printed on the
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