Webwork Multifile upload

Source: Internet
Author: User

When you manage the category icons the day before yesterday, you need to upload two icons at the same time. However, an error is always reported during processing and useful information is found on Google:

File Upload support has been rebuilt to allow for multiple files with the same HTTP parameter name. besides "Cos" and "Pell" support, "Jakarta" support has been added, utilizing the commons-fileupload library. only "Jakarta" supports multiple files with the same HTTP parameter name. in future versions "Jakarta" may become the default upload library, replacing "Pell", the author also said that the webwork. properties webwork. Set multipart. parser to com. opensymphony. webwork. Dispatcher. multipart. jakartamultipartrequest.

Let's take a look at our project's webwork. properties, it's so dizzy that webwork has set jakata as the default Upload Component. Our webwork. properties is still hard to set as Pell. Isn't this intentional murder?

At that time, the figure was refreshing. According to this settings, it was indeed successful. I came back to read the webwork code this morning and found it a bit wrong. Com. opensymphony. webwork. Dispatcher. multipart. multipartrequestwrapper in webwork contains several lines of code to determine which Upload Component to use. The following is an excerpt:

If (request instanceof multipartrequest ){

Multi = (multipartrequest) request;

} Else {

String parser = configuration. getstring (webworkconstants. webwork_multipart_parser );

 

// If it's not set, use Jakarta

If (parser. Equals ("")){

Log. Warn ("Property webwork. multipart. parser not set." +

"Using COM. opensymphony. webwork. Dispatcher. multipart. jakartamultipartrequest ");

Parser = "com. opensymphony. webwork. Dispatcher. multipart. jakartamultipartrequest ";

}

// Legacy support for Old Style property values

Else if (parser. Equals ("Pell ")){

Parser = "com. opensymphony. webwork. Dispatcher. multipart. pellmultipartrequest ";

} Else if (parser. Equals ("Cos ")){

Parser = "com. opensymphony. webwork. Dispatcher. multipart. cosmultipartrequest ";

} Else if (parser. Equals ("Jakarta ")){

Parser = "com. opensymphony. webwork. Dispatcher. multipart. jakartamultipartrequest ";

}

Why is it possible to set webwork. multipart. parser to com. opensymphony. webwork. Dispatcher. multipart. jakartamultipartrequest? In theory, it should be set to jakata. Unless the if clause has been executed, the following else clause is skipped.

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.