title: How to restrict file types being uploaded to Spring MVC3 Controller
body: <p>I am using Spring MVC3 to handle file upload for my web application. For now, I can restrict the file size being uploaded using the following configuration defined in my xml context file:</p>
  
  <pre><code>&lt;beans:bean id="multipartResolver"
      class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
      &lt;beans:property name="maxUploadSize" value="200000"/&gt; 
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p>I have scoured the web for how to restrict the file type but to no avail. Most of the articles I found only teach how to restrict the file size not the file type.
  Thank in advance for your help.</p>