upload方法:
*/
//
@At("/upload")
@Ok("json")
@AdaptBy(type = UploadAdaptor.class)
public void upload(TempFile file) throws IOException, JSONException, org.json.JSONException {
String tempFileName = file.getSubmittedFileName();
String nmRecId = tempFileName.substring(0, tempFileName.indexOf("-"));
.......
控制台报错:
DEBUG 10:07:26 UrlMappingImpl.get(101)-->Found mapping for [POST] path=/templateAdpterWpsAt/upload : TemplateAdpterWpsAt.upload(TemplateAdpterWpsAt.java:5650)
DEBUG 10:07:26 NutIoc.get(151)-->Get 'templateAdpterWpsAt'<class com.wonders.ghqfg.work.TemplateAdpterWpsAt>
DEBUG 10:07:26 UploadAdaptor.getReferObject(184)-->Select Html4 Form upload parser --> /ghqfgnw/templateAdpterWpsAt/upload
DEBUG 10:07:26 FastUploading.parse(39)-->FastUpload : /templateAdpterWpsAt/upload
DEBUG 10:07:26 FastUploading.parse(54)-->info created
DEBUG 10:07:26 FastUploading.parse(60)-->Params map created - 0 params
DEBUG 10:07:26 FastUploading.parse(77)-->boundary:
--ECPq1XMf8nzzYMKUAkQHTiX9S9HdvrYrqkn
DEBUG 10:07:26 FastUploading.parse(100)-->skip first boundary
DEBUG 10:07:26 FastUploading.parse(111)-->Reading...
DEBUG 10:07:26 FastUploading.parse(133)-->Upload File info: FilePath=[203313-81],fieldName=[file]
DEBUG 10:07:26 FastUploading.parse(137)-->Upload Info: name=203313-81,content_type=multipart/form-data
DEBUG 10:07:26 FastUploading.parse(231)-->...Done 13518 bytes readed
WARN 10:07:26 FailProcessor.process(28)-->Error@/templateAdpterWpsAt/upload :
java.lang.RuntimeException: r u kidding me?! It is impossible!
at org.nutz.lang.Lang.impossible(Lang.java:119)
at com.wonders.ghqfg.work.TemplateAdpterWpsAt$$FASTCLASS._invoke(TemplateAdpterWpsAt.java:1)
at org.nutz.lang.reflect.AbstractFastClass.invoke(AbstractFastClass.java:143)
at org.nutz.lang.reflect.FastClassFactory.invoke(FastClassFactory.java:67)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at com.wonders.tiles.processor.SecurityFilterProcessor.process(SecurityFilterProcessor.java:35)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)