Caught an exception while getting the property values of struts2檔案上傳報錯
遇到各種問題(難怪快被淘汰
一,struts2檔案上傳報錯 Caught an exception while getting the property values of
Struts2封裝了上傳檔案的過程,Action裡需要三個屬性(準確講只需要2個就夠了,第一個型別是File(例如:file),第二個型別是String(必須是fileFileName),第三個也是String(必須是fileContextType)並提供相應的getter,setter。
然後就可以直接通過FileUtils的copy方法實現檔案上傳。
但是!!!注意:檔名不能為單個字母!
原我應該是Struts2用到java的反射機制,來設定型別然後報錯。
因為單個字母,Struts裡面的反射會呼叫setF()來注入檔案。但是setF()方法明明有的。。。
不過我改為兩個字母的檔名,就OK了。。。。。
---------------------------------------------------------------轉載無需註明出處 by guin_guo
相關推薦
Caught an exception while getting the property values of struts2檔案上傳報錯
本人在今年暑假的一個小專案中用到前段時間學到的Struts2(別吐槽,,,遇到各種問題(難怪快被淘汰 一,struts2檔案上傳報錯 Caught an exception while getting the prop
springboot 檔案上傳報錯 Maximum upload size exceeded; nested exception is java.lang.IllegalStateException
# 最大支援檔案大小 spring.http.multipart.max-file-size=100MB # 最大支援請求大小 spring.http.multipart.max-request-siz
解決springMVC檔案上傳報錯: The current request is not a multipart request
轉自:https://blog.csdn.net/HaHa_Sir/article/details/79131607 解決springMVC檔案上傳報錯: The current request is not a multipart request 一、問題描述在使用springMVC做檔案上
Spring boot檔案上傳報錯: The temporary upload location is not valid
最近在做Excel匯入時,一次偶然的測試發現bug報錯如下: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is
Vue2.0 之 vue Cannot read property '__ob__' of undefined 異常(back報錯)
Vue2.0 之 back鍵報錯 (異常:vue Cannot read property ‘ob’ of undefined) 這個原因是因為我在本頁面迴圈了元件的原因,例如:
postman Installation has failed: There was an error while installing the application. Check the setup log for more information and contact the author
Error msg: Installation has failed: There was an error while installing the application. Check the setup log for more information and contact the autho
Getting the pixel coordinates of text or ticks in matplotlib
otl nat gen enum reference title info bsp http The exact pixel coordinates of title, labels, legends or ticks are important information f
Getting the IP address of the current machine using Java
On a computer that has one network adapter, the IP address that is chosen is the Primary IP address of the network adaptor in the computer. However, on a
Getting the GPU usage of NVIDIA cards with the Linux dstat tool
The dstat is an awesome little tool
Getting the most out of atmospheric data analysis
The study, an extension of previous data mining work that was carried out on measurements acquired at the same station, uses an additional 10 years of dat
Getting the Most Out of the Amazon S3 CLI
Editor’s note: For the latest information on Amazon S3, visit the By Scott Ward and Michael Ruiz, Partner Solutions Architects at AWS
Q&A: Trifacta's Sachin Chawla on getting the most out of Big Data Internet of Business
The insights offered by Big Data are key to many businesses today. Getting the information that's hidden within it isn't easy but there are plenty of compa
【已解決】mac上appium報錯:“Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path”
resource sset root could not fun ror 環境 apt direct 按照網上教程配置完appium環境後,真機跑自動化過程,遇到如下報錯: appium報錯如下: [ADB] Checking whether aapt is present
解決JDBC中“The server time zone value '???ú±ê×??±??' is...”報錯(即MySQL時區錯誤問題)
最近寫jsp,經常遇到MySQL時區錯誤的問題 每次遇到都要找一下設定的程式碼,太麻煩了,就自己寫篇部落格記錄一下 首先解決這個報錯主要有兩種方法,第一是在寫連線的URL時寫上一個“&serverTimezone = GMT” 語句(如果需要用到GMT+8的時區,需要
java程式在eclipse上執行報錯解決方法:Exception in thread "main" java.lang.NoClassDefFoundError:
最近在Linux上的eclipse中執行java程式出現了這樣的錯誤,弄了很久用了以下三種方法終後終於成功運行了,分享下,希望能幫助到大家。 Linux執行java程式提示錯誤: Exception in thread "main" java.lang.NoClassDefFoundEr
if multiple CL.EXE write to the same .PDB file, please use /FS (VS2013報錯)
Error 3 error C1041: cannot open program database 'c:\users\zenghongjun\desktop\gocloudserver\obj\debug\vc120.pdb'; if multiple CL.E
The SELECT would examine more than MAX_JOIN_SIZE rows 報錯分析 MYSQL
經過查詢資料發現,這個問題是由於查詢中,由於表的關聯太多,導致產生的表的記錄超過了臨時表空間的最大容量的問題。如何解決?沒有什麼萬能的方法,把表的記錄在關聯前弄少,以及這個是臨時表有這個限制,所以說如果是一張實際存在的表,就不存在這個臨時表空間超出的問題了,可以
java.sql.SQLException: The server time zone value '???ú±ê×??±??'的報錯解決方案
問題描述: 利用JDBC連線資料時,會報錯誤具:java.sql.SQLException: The server time zone value '???ú±ê×??±??' is unrecognized or represents more than one time zone. Yo
檔案上傳相關報錯: The current request is not a multipart request或is a MultipartResolver configured?
1:The current request is not a multipart request 1:from中涉及到圖片上傳的就要用post提交方式。否則就會報這個錯誤。 2:第一中:在jsp頁面的<head></head>標籤裡面加上&
檔案上傳時顯示The request sent by the client was syntactically incorrect ()
前端頁面涉及到檔案上傳的時候,標籤中不只需要action屬性,還需要新增enctype="multipart/form-data"以及規定提交方式method=“post”,即: <form name="documentInsert"enctype="multipart/form-