/** * Read the contents of Excel data * * @param inputstream */ public void Readexcelcontent (InputStream is) { try { wb = new Xssfworkbook (IS); sheet = wb.getsheetat (0); //Gets all lines in the Excel file excluding the first row of headings int rowNum = Sheet.getlastrownum (); System.out.println ("Total number of rows:" +rownum); //Traverse rows for (int i = 1; I //Read left upper cell Row row = Sheet.getrow (i); //Line not empty if (row! = null) { String value = "";
); - the //add merged cells in sheet - sheet.addmergedregion (CRA); - -Row row = Sheet.createrow (0); + -Cell Cell_1 = Row.createcell (3); + ACell_1.setcellvalue ("When you ' re right, no one remembers, when you ' re wrong, no one forgets."); at - //cell position 3-9 is merged into a single cell, no matter how you create a 4th cell or a 5th cell ... Then write the data. are not writable. -Cell cell_2 = Row.createcell (
Java read-write Excel package is Apache POI (Project address: http://poi.apache.org/), so you need to obtain the POI jar package, this experiment is using the POI 3.9 stable version.
Apache POI code
Recently, due to work requirements, a tool class for Excel operations is based on poi. Share with you.
Package COM. shine. framework. core. office; import Java. io. fileinputstream; import Java. io. filenotfoundexception; import Java. io. fileoutputstream; import Java. io. ioexception; import Java. util. arraylist; import Java. util. list; import Org. apache. poi
(File.getabsolutepath ()); the theWorkbook Workbook =workbookfactory.create (file);98Sheet Sheet = Workbook.getsheetat (0); About - //merge cells, add merged cells to a worksheet101Cellrangeaddress Headspan =NewCellrangeaddress (2,2,0,4);102 sheet.addmergedregion (headspan);103 104 //set the header text in the merged position theRow row = Sheet.createrow (0);106Cell cell = Row.createcell (0);107Cell.setcellvalue ("This is the table header .");108 109
Process: (similar to JXL, just reading logic a little different)
The two main differences with JXL:
1, read and write a slightly different way:
(1) POI read:
[Java] view plain copy print?
(2) JXL read:
[Java] view plain copy print?
2. The data types are judged in a slightly different way:
(1) Personally feel that the data type processing, poi than JXL convenient and practical,
, to achieve map function;(9) Peripheral radar: The use of peripheral radar function, developers can be in the app low-cost, fast to find the surrounding use the same app user location function;LBS Cloud Search: Support to query the data stored in the LBS cloud;(11) Tile layer: Support to add own tile data on the map.(12) Featured features: Provide short-string sharing, place details search, hot force and other features to help developers build more powerful applications;2, create the applicatio
"Org.slf4j.impl.StaticLoggerBinder".Slf4j:defaulting to No-operation (NOP) Logger implementationSlf4j:see Http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.This is due to no dependency on adding log4j. We need to add this dependency to Maven and do the following:Opens a. pom file and joins a new dependency in dependenciesSave.Then recompile and re-execute the Exec:javaYou can see that the program is running correctly.001002The output information of
. Application Conditions of Rewrite Rules
---- When your Web request is directed to the Apache daemon of a Web server, Apache determines whether the request is a master configuration or a virtual host based on the configuration file, then, the rewrite rule is matched based on the URL requested by the user in the browser and based on the actual Request Path. rewrite Rules in htaccess, and finally return the
based on the URL requested by the user in the browser and based on the actual Request Path. rewrite Rules in htaccess, and finally return the request content to the user. There may be two types of responses.
---- 1. Redirect the external request content (redirect) to another URL
---- Let the browser send a request again with a new URL (r = 301 or R = 302, temporary or permanent redirection ).
---- For example, a website has a regular URL and an
Apache here to introduce my Redhat Linux 7.2 under the integration of Apache and TOMCAT4 process, focusing on mod_webapp.so production methods,
And in the virtual Host environment configuration, management and application, has been tested successfully. I hope to help you, please correct me if you have any mistakes.
First, the correct installation of TOMCAT4
Installation of the necessary software, as follows
An example of how to solve Apache faults-Linux Enterprise Application-Linux server application information. The following is a detailed description. Fault description: on a server, start the apache process as a wacos user and immediately use the command ps? Ef | grep httpd can see that a process is started, but an error will be reported when you access the web in
At present, the site page is mainly divided into static pages and dynamic pages, static pages composed of a site is relatively rare, a large site is generally used in the dynamic site building technology, there are some sites are static Web pages and dynamic Web pages coexist,This article takes Apache server, PHP language as an example, explain the dynamic website access process, the following directly into
At present, the site page is mainly divided into static pages and dynamic pages, pure static pages of the site is relatively rare, the general use of large sites are dynamic site building technology, there are some sites are static Web pages and Dynamic Web site coexistence, this article to Apache Server, PHP language, for example, Detailed dynamic website access process, the following directly into the top
Currently, website pages are mainly divided into static pages and dynamic pages. Websites composed of pure static pages are relatively rare. Large websites generally use dynamic website construction technology, another part of the website is the coexistence of static and dynamic web pages. This article takes the Apache server and php language as an example to explain the dynamic website access process. The
that in the directory Rights Management consistency higher.mod_fastcgi
Although the CentOS 6.x is Apache 2.2, it has been successfully transplanted: https://github.com/ceph/mod-proxy-fcgi We can use directly, and fortunately it has entered the Epel source, directly yum installation can be Do not want to match Epel source, direct download RPM package installation can also (example http://mirrors.ustc.edu.cn
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.