c
@AdaptBy(type = UploadAdaptor.class, args = { "${app.root}/assets/upload/tmp" })
@POST
@At("/excelimport")
@Ok("void")
public void excelimport(@Param("uploadfile") File f){
try
{
log.debug(f.getName());
// ImportExcel ei = new ImportExcel(f, 1, 0);
// List<Tea_jxpjbm> list = ei.getDataList(Tea_jxpjbm.class);
// log.debug(list.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
f
<form id="importForm" method="post" enctype="multipart/form-data" action="${base}/platform/jxfzxt/jxpjbm/excelimport"
style="padding-left:20px;text-align:center;" ><br/>
<input name="uploadfile" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/>
</form>
[DEBUG] 2017-05-07 16:03:49,375 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:39) - FastUpload : /platform/jxfzxt/jxpjbm/excelimport
[DEBUG] 2017-05-07 16:03:49,378 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:54) - info created
[DEBUG] 2017-05-07 16:03:49,380 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:60) - Params map created - 0 params
[DEBUG] 2017-05-07 16:03:49,380 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:77) - boundary:
------WebKitFormBoundaryO3qggYkOyeVn7LUN
[DEBUG] 2017-05-07 16:03:49,380 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:100) - skip first boundary
[DEBUG] 2017-05-07 16:03:49,381 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:111) - Reading...
[DEBUG] 2017-05-07 16:03:49,381 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:133) - Upload File info: FilePath=[],fieldName=[uploadfile]
[DEBUG] 2017-05-07 16:03:49,382 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:137) - Upload Info: name=,content_type=application/octet-stream
[DEBUG] 2017-05-07 16:03:49,382 org.nutz.mvc.upload.FastUploading.parse(FastUploading.java:231) - ...Done 194 bytes readed
java.lang.NullPointerException
at cn.wizzer.app.web.modules.controllers.platform.jxfzxt.TeaJxpjbmController.excelimport(TeaJxpjbmController.java:82)
at cn.wizzer.app.web.modules.controllers.platform.jxfzxt.TeaJxpjbmController$FM$excelimport$b104b5d140fd15da59a2f3e28e8b3209.invoke(TeaJxpjbmController.java)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)