开发者社区> 问答> 正文

Jfinal 上传文件时的问题?报错

然后 当表单提交时报错

没有一点头绪呢  你们能帮帮我吗

展开
收起
爱吃鱼的程序员 2020-06-09 16:12:28 511 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    >>06:10:10:错找不到指定模板或者加载错(TEMPLATE_LOAD_ERROR):位于0行资源:/Fileupload/getFileupload.html模板根目录为C:\tomcat\webapps\baobiao_uib\WEB-INF\ui
    java.lang.RuntimeException:DirectoryC:\tomcat\webapps\baobiao_uib\upload\C:\tomcat\webapps\baobiao_uib\upload\img\notexistsandcannotcreatedirectory.
       atcom.jfinal.upload.MultipartRequest.wrapMultipartRequest(MultipartRequest.java:95)
       atcom.jfinal.upload.MultipartRequest.<init>(MultipartRequest.java:53)
       atcom.jfinal.core.Controller.getFiles(Controller.java:734)
       atcom.jfinal.core.Controller.getFile(Controller.java:739)
       atcom.bvtc.controller.FileUpload.getFileupload(FileUpload.java:17)
       atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
       atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       atjava.lang.reflect.Method.invoke(Method.java:497)
       atcom.jfinal.aop.Invocation.invoke(Invocation.java:73)
       atcom.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
       atcom.bvtc.handler.GlobalHandler.handle(GlobalHandler.java:37)
       atcom.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
       atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
       atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
       atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
       atorg.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
       atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
       atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
       atorg.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
       atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
       atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
       atorg.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
       atorg.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
       atorg.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2503)
       atorg.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2492)
       atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       atorg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
       atjava.lang.Thread.run(Thread.java:745)

    <spanstyle="color:#808080;font-style:italic;">/**<spanstyle="color:#808080;font-style:italic;">CreatedbyCorbieon2016/4/1.<spanstyle="color:#808080;font-style:italic;">/<spanstyle="color:#000080;font-weight:bold;">publicclassFileUpload<spanstyle="color:#000080;font-weight:bold;">extendsController{<spanstyle="color:#000080;font-weight:bold;">publicvoidgetFileupload(){<spanstyle="color:#000080;font-weight:bold;">try{StringmHttpUrl=PathKit.<spanstyle="font-style:italic;">getWebRootPath()+<spanstyle="color:#008000;font-weight:bold;">"<spanstyle="color:#000080;font-weight:bold;">\<spanstyle="color:#008000;font-weight:bold;">upload<spanstyle="color:#000080;font-weight:bold;">\<spanstyle="color:#008000;font-weight:bold;">img<spanstyle="color:#000080;font-weight:bold;">\<spanstyle="color:#008000;font-weight:bold;">";<spanstyle="color:#000080;font-weight:bold;">intmaxSize=<spanstyle="color:#0000ff;">10<spanstyle="color:#0000ff;">1024<spanstyle="color:#0000ff;">1024;<spanstyle="color:#808080;font-style:italic;">//10M<spanstyle="color:#808080;font-style:italic;">UploadFileupFile=getFile(<spanstyle="color:#008000;font-weight:bold;">"file",mHttpUrl,maxSize,<spanstyle="color:#008000;font-weight:bold;">"utf-8");System.<spanstyle="color:#660e7a;font-weight:bold;font-style:italic;">out.println(upFile.getFileName());}<spanstyle="color:#000080;font-weight:bold;">catch(Exceptione){e.printStackTrace();}}<spanstyle="color:#000080;font-weight:bold;">publicvoidselect(){render(<spanstyle="color:#008000;font-weight:bold;">"/yqj/testFileupload.html");}}

    2020-06-09 16:12:45
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载