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.