Jfinal自带的UploadFile上传图片问题!
视频学习jFinal ,学习使用Jfinal上传文件到项目中!
页面上
<form method="post" action="<%=basePath%>ddbox/add" enctype="multipart/form-data"> <input type="file" name = "img" /> <button type="submit" id="save">保存</button> </form>
UploadFile upload = getFile("img");
[ERROR]-[Thread: http-8081-1]-[com.jfinal.core.ActionHandler.handle()]: /ddbox/add java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:61) at com.dxcm.interceptor.LoginCheckInterceptor.intercept(LoginCheckInterceptor.java:12) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.jfinal.ext.interceptor.SessionInViewInterceptor.intercept(SessionInViewInterceptor.java:44) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.dxcm.interceptor.GlobalInterceptor.intercept(GlobalInterceptor.java:21) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.jfinal.ext.interceptor.SessionInViewInterceptor.intercept(SessionInViewInterceptor.java:44) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:73) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55) ... 22 more Caused by: java.lang.NoClassDefFoundError: com/oreilly/servlet/multipart/FileRenamePolicy at com.jfinal.core.Controller.getFiles(Controller.java:677) at com.jfinal.core.Controller.getFile(Controller.java:687) at com.dxcm.controller.DdBoxController.add(DdBoxController.java:83) ... 27 more Caused by: java.lang.ClassNotFoundException: com.oreilly.servlet.multipart.FileRenamePolicy at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 30 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
天呐咯,原来就是少了一个cos的jar包
在实际生产环境中 服务器运行效果应当如此
引用来自“xwalker”的评论
你引入COS的jar包了吗
引用来自“xwalker”的评论
你引入COS的jar包了吗
add("/admin", AdminController.class); 这个是configRoute方法的内容
你的configRoute代码贴出来看看
你引入COS的jar包了吗