title: Set file path in <s:file> in Struts2 while open for edit mode
body: <p>I have one file upload field in my struts2 form like:  </p>
  
  <p><code>&lt;s:file label="Upload" name="file" id="file" size="40" cssClass="width284" value="%{file}"/&gt;</code>  </p>
  
  <p>this work perfectly for upload file, now when i <code>open this form again in edit mode</code> to edit information <code>i got this file field empty</code> i.e. file name (with path) not found in file browser text box. I have getter/setter method for the file object and i have set file in the pojo object which i get as result.  </p>
  
  <p>I have also set value in file tag, still not getting file name in text box of the file tag.  </p>
  
  <p>I dont know how this happend any one know about this.<br>
  Thanks in advanced.</p>
  
  <p><strong>EDITED</strong><br>
  My JSP file :-  </p>
  
  <pre><code>&lt;form name="library" id="library" method="post" action="addlibrary" enctype="multipart/form-data" &gt;
  &lt;div&gt;&lt;s:textfield name="title" value="%{title}" id="title" label="Title" cssClass="width284"/&gt;&lt;span class="red"&gt;*&lt;/span&gt;&lt;div&gt;
  &lt;div&gt;&lt;s:file label="Upload" name="file" id="file" size="40" cssClass="width284" value="%{file}" /&gt;&lt;/div&gt;
  &lt;div&gt;&lt;span class="submit" &gt;&lt;s:submit name="submit" value="Add to Library" cssStyle="width:130px;"&gt;&lt;/s:submit&gt;&lt;/span&gt; &lt;/div&gt;
  </code></pre>
  
  <p>  </p>
  
  <p>My action class code while open for edit :-   </p>
  
  <pre><code>private File file;
  private String fileContentType;
  private String fileFileName;    
  
  public String edit() {
      if (this.object.getId() == 0) {
          this.object = null;
          return SUCCESS;
      } else {
          this.object = this.objectDAO.getobjectContent(this.object.getId());
          String filePath = "d:\\myProject\\Documents\\"+ this.object.getFileName();
          this.file = new File(filePath);
          return INPUT;
      }
  }
  </code></pre>