In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about what matters need to be paid attention to when uploading files in webwork. Many people may not know much about it. In order to let everyone know more, Xiaobian summarizes the following contents for everyone. I hope you can gain something according to this article.
When using the webwork framework, use apache's own file upload function, so there are several places to pay attention to:
1. Because webwork comes with the jar package uploaded, so you need to make http request go through webwork interceptor, then the specific configuration is to configure interceptor in xwork.xml:
2. Webwork's built-in interceptor only intercepts enctype="multipart/form-data" in the form form.
3. The name of the tag written in the page can only be: uploadFile, so the corresponding get and set methods must be obtained in the background action.
Then, the value can only be obtained when processing the business logic. At this time, the uploadFile obtained is the temporary file path of.tmp, which is placed on the server. After the action is executed, it will be deleted automatically.
4. In this file upload interceptor, if multiple files are uploaded, use: name="uploadFiles", the background can be obtained using arrays; if a single file is uploaded, then the name in the input field must be
uploadFile; and in the uploaded action, two fields are fixed, which can be directly obtained in the action: uploadFilesContentType and uploadFilesFileName. These two attributes have been bound to the action.
After reading the above, do you have any further understanding of what you need to pay attention to when uploading files in webwork? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.