title: How can I parse multipart/form-data parameters in JSP?
body: <p>In trying to get parameters from the request in a JSP, and for some reason we can't use servlets.</p>
  
  <p>I want to emulate that servlet behavior (doPost, doGet, doPut, etc) in a JSP page, we have a lot of them. Something like: </p>
  
  <p>JSP File:</p>
  
  <pre><code>    &lt;%
          new SomeClass(request, response).doRequest();
      %&gt;
      &lt; !--HTML--&gt;
  </code></pre>
  
  <p>I know i can get the request method with <code>request.getMethod()</code>, the GET parameters parsing <code>request.getQueryString()</code>, and the body parsing the data in <code>request.getReader()</code>.</p>
  
  <p>But the body looks like this when submitting from a form</p>
  
  <pre>
  
  
  ------WebKitFormBoundaryklIJzgCDUQ00bFB8
  Content-Disposition: form-data; name="a"
  
  123
  ------WebKitFormBoundaryklIJzgCDUQ00bFB8
  Content-Disposition: form-data; name="b"
  
  456
  ------WebKitFormBoundaryklIJzgCDUQ00bFB8
  Content-Disposition: form-data; name="c"; filename="text.txt"
  Content-Type: text/plain
  
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed erat justo. Vestibulum id dui felis. Donec sagittis, nibh sit amet interdum dignissim, magna velit pulvinar odio, ut ornare dui nunc et quam. Sed vel lorem vestibulum, semper libero a, aliquet nunc. Praesent urna tortor, euismod nec dolor hendrerit, scelerisque vehicula nisl. Nunc a interdum mi, sed rhoncus elit. Sed nec lacus ultrices, dictum tellus sed, aliquam arcu. In pretium imperdiet dui, et rutrum ipsum commodo sit amet. Aliquam cursus metus ac imperdiet aliquam.
  ------WebKitFormBoundaryklIJzgCDUQ00bFB8--
  </pre>
  
  <p>So it won't be easy to parse.</p>
  
  <p>Then in that class i'll have both the GET parameters and body parameters separately, the request method and files maybe.</p>
  
  <p>Is there an utility, class, framework that can do this parse from the request object, or any advice you can give me.</p>
  
  <p>I'm not against using servlets, but we have a lot of JSP files already created, and we will have to specify a servlet path for the each one, like <code>/posts</code></p>