Workbook workbook = (workbook) modelutils.getrequestcontext (). Getactioncontext (). GetParameter ("Excel");
Sheet Sheet = workbook.getsheetat (0);
System.out.println ("----------sheet0--------------");
First Behavior header row
Get second row data: Sheet.getrow (1)
Org.apache.poi.ss.usermodel.Row row= Sheet.getrow (1);
Set Cell type
Cell cell = Row.getcell (0);
System.out.println (cell.getcelltype ());
Celltype 0 is a numeric type that automatically becomes the scientific notation format when the number is too long
Output is 1.01001007835E9
So when a string of pure numbers reads a full number in Java, you need to convert the cell format to text type
Cell.setcelltype (1); 1 represents the format of a cell type as text
String Material_number = cell.tostring ();
System.out.println (Material_number);
Output as: 101001007835
Other ways to convert types
Hssfworkbook wb = new Hssfworkbook ();
Hssfcellstyle CellStyle = Wb.createcellstyle ();
Hssfdataformat format = Wb.createdataformat ();
Cellstyle.setdataformat (Format.getformat ("@"));