Java – how to avoid resetting fileuploadfield at the end of a request in wicket

I have a wicket form with fileuploadfield and more text fields Verification of correctness fails when required fields are missing Then, the file I selected for upload becomes empty, so I have to select it again before submitting the form with all the required fields filled in

In fact, fileuploadfield documentation says:

Is there any way to keep the selected file when the form validation fails?

Solution

can't. The problem is that the browser refreshes it, and for security reasons, you cannot set the default value on the file field

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>