Unable to find the 'struts. multipart. savedir' struts2 File Upload error Solution

Source: Internet
Author: User

Unable
To find the 'struts. multipart. savedir' struts2 File Upload error Solution
From http://www.itzhai.com/unable-to-find-struts-multipart-savedir-struts2-upload-file-error-solution.htmlThis article was published by Arthur King in 274
I wrote the original itzhai.com article a few days ago. I have not commented on this article yet.
Watched 2,243 views +

This error occurs when you upload files in a struts2 project:

2011-7-30 20:29:02 COM. opensymphony. xwork2.util. logging. commons. commonslogger info: unable to find 'struts. multipart. savedir 'Property setting. defaulting to javax. servlet. context. tempdir2011-7-30 20:29:02 COM. opensymphony. xwork2.util. logging. commons. commonslogger info: removing File Upload F: \ software_programming \ project \ source code \. metadata \. plugins \ Org. eclipse. WST. server. core \ tmp0 \ work \ Catalina \ localhost \ musicalinstrumentsstore \ upload _ 365daacc_1317af78b8c _ 7ffe_00000001.tmp

The reason is that the folder for storing temporary files is not set, and Struts. multipart. savedir in the error prompt is to set the properties of the Temporary Folder and write the configuration to the struts. properties file, as shown below:

struts.multipart.saveDir = /tmp

If this folder does not exist, Struts 2 will automatically create one.

You can also add a constant setting in the Struts. xml configuration file: (this method is recommended)

<constant name="struts.multipart.saveDir" value="/tmp"></constant>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.