文件上传错误:Error setting expression 'uploadImage' with value '[Ljava.lang.String;@5ff8a691'

警告: Error setting expression ‘uploadImage‘ with value ‘[Ljava.lang.String;@5ff8a691‘

ognl.MethodFailedException: Method "setUploadImage" failed for object [email protected] [java.lang.NoSuchMethodException: cn.itcast.upload.UploadAction.setUploadImage([Ljava.lang.String;)]

at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1292)

at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1481)

at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)

at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)

at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27)

at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2318)

at com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:77)

at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2318)

at ognl.ASTProperty.setValueBody(ASTProperty.java:127)

at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)

at ognl.SimpleNode.setValue(SimpleNode.java:301)

at ognl.Ognl.setValue(Ognl.java:737)

at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)

at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:173)

at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:160)

at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:151)

at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:292)

at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:203)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)

at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510)

at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)

at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2440)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2429)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:744)

Caused by: java.lang.NoSuchMethodException: cn.itcast.upload.UploadAction.setUploadImage([Ljava.lang.String;)

at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1233)

... 69 more

/-- Encapsulated exception ------------\

java.lang.NoSuchMethodException: cn.itcast.upload.UploadAction.setUploadImage([Ljava.lang.String;)

at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1233)

at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1481)

at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)

at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)

at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27)

at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2318)

at com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:77)

at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2318)

at ognl.ASTProperty.setValueBody(ASTProperty.java:127)

at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)

at ognl.SimpleNode.setValue(SimpleNode.java:301)

at ognl.Ognl.setValue(Ognl.java:737)

at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)

at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:173)

at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:160)

at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:151)

at com.opensymphony.xwork2.intercept

or.ParametersInterceptor.setParameters(ParametersInterceptor.java:292)

at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:203)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)

at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)

at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)

at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510)

at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)

at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2440)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2429)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:744)

\--------------------------------------/

该错误的出现时因为没有在form表单中设置enctype=“multipart/form-data”。form表单以二进制的方式查询。

表单中enctype="multipart/form-data"的意思,是设置表单的MIME编码。默认情况,这个编码格式是application/x-www-form-urlencoded,不能用于文件上传;只有使用了multipart/form-data,才能完整的传递文件数据,进行下面的操作.

文件上传错误:Error setting expression 'uploadImage' with value '[Ljava.lang.String;@5ff8a691'

时间: 2024-12-04 20:26:53

文件上传错误:Error setting expression 'uploadImage' with value '[Ljava.lang.String;@5ff8a691'的相关文章

文件上传Error setting expression 'upload' with value '[Ljava.lang.String

ognl.MethodFailedException: Method "setUploadImage" failed for object [email protected] [java.lang.NoSuchMethodException: cn.itcast.upload.UploadAction.setUploadImage([Ljava.lang.String;)] at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.ja

sruts警告: Error setting expression 'myfile' with value '[Ljava.lang.String;@10c0f66'

警告: Error setting expression 'myfile' with value '[Ljava.lang.String;@10c0f66'ognl.MethodFailedException: Method "setMyfile" failed for object [email protected] [java.lang.NoSuchMethodException: com.zw.monday.UploadAction.setMyfile([Ljava.lang.S

strut2 自己定义文件上传错误信息

在文件上传过程中我们能够指定拦截器对文件类型.后缀名.大小进行设定,action中的配置: <interceptor-ref name="fileUpload"> <param name="maximumSize">500000</param> <param name="allowedTypes">application/vnd.ms-excel</param> <param na

雷林鹏分享:CodeIgniter文件上传错误:escapeshellarg() has been disabled for security reasons

CodeIgniter文件上传错误:escapeshellarg() has been disabled for security reasons 原因:escapeshellarg函数被禁止 解决方法: 1.修改PHP配置文件php.ini,找到 disable_functions 字段,删除 escapeshellarg . 2.重启php-fpm(nginx环境). 文章转载自 [http://www.php230.com] (编辑:雷林鹏 来源:网络 侵删) 原文地址:https://w

Spring SpringMVC文件上传错误(二)

续上文, 场景: 不上传文件提交表单. 简述一下:表单请求的两种方式 同步提交 异步提交 笔者之前写过的测试Demo: HTML: <form action="upload.do" method="post" enctype="multipart/form-data"> <input type="file" name="fileName" /> <input type=&quo

ajaxfileupload.js 文件上传

一,前台代码. <input id="fileToUpload" type="file" size="25" name="fileToUpload" class="input"> <button class="button" id="buttonUpload" onclick="return ajaxFileUpload();"&

Spring MVC文件上传和下载

在Spring MVC中有两种实现上传文件的办法,第一种是Servlet3.0以下的版本通过commons-fileupload与commons-io完成的通用上传,第二种是Servlet3.0以上的版本的Spring内置标准上传,不需借助第3方组件.通用上传也兼容Servlet3.0以上的版本 Servlet3.0以下的通过commons-fileupload上传 1.添加上传依赖包 一个是文件上传的jar包,一个是其所依赖的IO包.这两个jar包,均在Spring支持库的org.apache

单个文件上传

一.新建一个1107.php文件,在文件中写出如下代码: <DOCTYPE html> <html> <head> <title>文件上传</title> </head> <body> <form method="post" action="t2.php" enctype="multipart/form-data"> <input type=&q

101)PHP,多文件上传

就是在之前的单文件上传的基础上加了一个函数: 1 <?php 2 /** 3 * 上传函数 4 * @param $tmp_file $_FILES的五个信息,比如upload($_FILES('mingzi') 5 * $_FILES里面的名字是你的对应的html代码中的上传文件的那个name 6 * @return bool 失败返回false,成功就是true 7 */ 8 $tmp_file=$_FILES['picture']; 9 function upload($tmp_file)