title: spring annotation validation for form input file
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7161215/spring-multipartfile-validation-and-conversion">Spring MultipartFile validation and conversion</a>  </p>
  </blockquote>
  
  
  
  <p>I need to check whether file has been provided by user from jsp page.</p>
  
  <p>The codes are as follows.</p>
  
  <p>When I run in debug mode the file(MultiPartFile) is not null, though the file was not provided.</p>
  
  <p>I want to use annotation based validation for everything.</p>
  
  <p>Any help would be appreciated.</p>
  
  <pre><code>    &lt;form:form modelAttribute="timeStampIssueParam"
          action="${pageContext['request'].contextPath}/timestamp/issue"
          method="post" enctype="multipart/form-data"&gt;
          &lt;fieldset&gt;
              &lt;p&gt;
                  &lt;form:label for="file" path="file"&gt;PDF Original&lt;/form:label&gt;
                  &lt;br /&gt;
                  &lt;form:input path="file" type="file"/&gt;
              &lt;/p&gt;
              &lt;p&gt;
  
  
  
      @NotNull
      private List&lt;MultipartFile&gt; file
  
      public void issue(HttpServletResponse response, @Valid TimeStampIssueParam tsIssueParam, BindingResult result) throws JsonGenerationException, JsonMappingException, IOException {
  </code></pre>