工程环境:struts2。在测试过程中,出现如下info信息:
Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir
提示该 struts.multipart.saveDir属性未设置。
在运行上述例子,如果您留心一点的话,应该会发现服务器控制台有如下输出:
Jun 21 , 2011 1 : 25 : 37 PM org.apache.struts2.dispatcher.Dispatcher getSaveDir
INFO: Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir
Jun 21 , 2011 1 : 25 : 37 PM org.apache.struts2.interceptor.FileUploadInterceptor intercept
INFO: Removing file myFile C:\Program Files\Tomcat 5.5 \work\Catalina
\localhost\Struts2_Fileupload
\upload_251447c2_1116e355841__7ff7_00000006.tmp
上述信息告诉我们,struts.multipart.saveDir没有配置。
struts.multipart.saveDir用于指定存放临时文件的文件夹,该配置写在struts.properties文件或者struts.xml配置文件中。例如,如果是struts.properties文件,则加入如下代码:struts.multipart.saveDir = /tmp/;或者是struts.xml配置文件,则增加如下代码:<constant name="struts.multipart.saveDir" value="/tmp"/>,设置临时文件上传路径。就能解决此问题。
分享到:
相关推荐
struts2文件上传中的struts.multipart.saveDir提示信息,是没有设置struts2上传的临时文件夹造成的,下面说了两种设置的方法
tomcat报错Unable to find 'struts multipart saveDir解决
struts.multipart.saveDir 该属性指定上传文件的临时保存路径,该属性的默认值是javax.servlet.context.tempdir. struts.multipart.maxSize 该属性指定Struts 2文件上传中整个请求内容允许的最大字节数. struts....
struts.multipart.saveDir The directory to use for storing uploaded files 设置存储上传文件的目录夹 struts.objectFactory The com.opensymphony.xwork2.ObjectFactory implementation class ...
通过import org.springframework.web.multipart.MultipartFile;上传文件的一个工具性的jar.
org.apache.struts2.components.template, org.apache.struts2.config, org.apache.struts2.dispatcher, org.apache.struts2.dispatcher.mapper, org.apache.struts2.dispatcher.multipart, org.apache.struts2....
at org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.cleanUp(MultiPartRequestWrapper.java:271) at org.apache.struts2.dispatcher.Dispatcher.cleanUpRequest(Dispatcher.java:837) at org....
plugin-2.5.10.1.jar,struts2-pell-multipart-plugin-2.5.10.1.jar,struts2-plexus-plugin-2.5.10.1.jar,struts2-portlet-plugin-2.5.10.1.jar,struts2-rest-plugin-2.5.10.1.jar,struts2-sitegraph-plugin-2.5...
增加S2-057 Struts 2.3 to 2.3.34,Struts 2.5 to 2.5.16 此漏洞影响范围非常小,要求配置条件比较苛刻,同时,一些特定版本没有看到有沙盒绕过,说以,目前exp只是基于S2-045改写的,所以exp并不是所有版本都能用,...
struts2-pell-multipart-plugin-2.3.24.jar, struts2-plexus-plugin-2.3.24.jar, struts2-sitegraph-plugin-2.3.24.jar, struts2-sitemesh-plugin-2.3.24.jar, struts2-spring-plugin-2.3.24.jar, struts2-...
org.apache.struts2.dispatcher.multipart Classes to help dispatch multipart HTTP requests. org.apache.struts2.dispatcher.ng This package contains a reimagining of the traditional Struts filter ...
微信小程序多文件上传
<constant name="struts.multipart.saveDir" value="d:\"></constant> <package name="default" extends="struts-default"> class="com.struts2.action.FileUploadAction"> <result name="success">/...
2.fileUpload拦截器的maximumSize属性必须小于struts.multipart.maxSize的值。 struts.multipart.maxSize默认2M,当maximumSize大于2M时, 必须设置struts.multipart.maxSize的值大于maximumSize。 3.当上传的文件...
还在为找不到jar文件烦心吗,不用了到我空间来有你想要的,持续更新。。。 struts2-pell-multipart-plugin-2.2.1.jar
struts2-pell-multipart-plugin-2.1.6.jar
struts2-pell-multipart-plugin-2.3.30.jar, struts2-plexus-plugin-2.3.30.jar, struts2-portlet-plugin-2.3.30.jar, struts2-rest-plugin-2.3.30.jar, struts2-sitegraph-plugin-2.3.30.jar, struts2-sitemesh-...
struts2漏洞exp利用工具, 2018-08-24: 增加S2-057 Struts 2.3 to 2.3.34,Struts 2.5 to 2.5.16 此漏洞影响范围非常小,要求配置条件比较苛刻,同时,一些特定版本没有看到有沙盒绕过,说以,目前exp只是基于S2-...
2.其次JSP页面中的文件上传控件所在的form必须设置属性enctype="multipart/form-data" 3.再次,struts2中文件上传将底层高度封装了。在使用时只需要在ACTION中添加三个字段(其中 List<File> files为必填项),...
<constant name="struts.multipart.saveDir" value="D:\\upload\\"> <!-- Action所在包定义 --> <package name="C04.4" extends="struts-default"> <!-- Action名字,类以及导航页面定义 --> <...