title: HTML file input: load already existing filename
body: <p>I'm developing a simple Spring web application to manage documents in PDF format, which should be able to perform the usual operations: list them, add a new one, delete and update. These operations go to a MS SQL Server db (the documents table has a VARBINARY(MAX) field to store the document's bytes). The problem arrives when updating a (previously added) file.
  Adding the file is easy. The simplied form in the JSP is like this one:</p>
  
  <pre><code>&lt;form:form method="post" action="AddDoc" commandName="document" enctype="multipart/form-data"&gt;
              &lt;table id="documentTable"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;p&gt;Choose file:&lt;/p&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;p&gt;&lt;input type="file" name="file" path="file" size="40" value="${document.file}"&gt;&lt;/p&gt;
                          &lt;p&gt;&lt;sf:errors path="file" class="error"/&gt;&lt;/p&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  &lt;tr&gt;
                      &lt;td colspan="2"&gt;
                          &lt;p class="submit"&gt;&lt;input id="submitForm" type="submit" name="commit" value="Go"&gt;&lt;/p&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  &lt;/table&gt;
          &lt;/form:form&gt;
  </code></pre>
  
  <p>As you see the form sends a Document object when submitted, which is validated by the controller and inserted into the database. This Document object stores the document's bytes into a MultipartFile before insertion.
  Now I want to update this Document object, so the JSP page is the same one as for adding, with the difference that the already existing Document has to be loaded from DB prior to show the page. The form is now populated with the Document info, except the input file field, which I don't know why doesn't get populated (while you can see that <code>value="${document.file}"</code>). The problem is that the user might not need to update the file itself, only the other associated attributes that appear on the form, but when it is submitted all fields are properly encapsulated within Document object, except for the file which is empty and causes validation to fail.
  I would like to be able to populate the file input field when the update document JSP page is loaded, so the info can be sent again if the user submits the form without changing this field.</p>
  
  <p>I've thought about other solutions, like modifying the validator to accept an empty file field and then getting the info again from DB or session, but this doesn't look neat.</p>
  
  <p>What do you think would be a good approach?</p>