title: Recieve 400 Bad Request when using Jquery Form Plugin
body: <p>I changed my code to using the Jquery Form Plugin so that I could upload pictures. My original form was simple</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "register.htm",
      data:{
              account_name: $('#regAccount_name').val(),
              pwd: MD5($('#regPwd').val()),
              fname: $('#regFname').val(),
              lname: $('#regLname').val(),
      },
      success: function(data){
          changeMainIFrame('MenuFrame.jsp?regStatus=User Successfully Registered');
      },
      error:function(e){
          console.log("sendRegistration(): " + e);
      }
  
  });
  </code></pre>
  
  <p>but changed to this </p>
  
  <pre><code>    var options = { 
           beforeSend: function() 
           {
               //alert(MD5($('#regPwd').val()));
              // document.getElementById('regPwd').value = MD5($('#regPwd').val());
  
           },
           uploadProgress: function(event, position, total, percentComplete) 
           {
  
           },
           success: function() 
           {
               changeMainIFrame('MenuFrame.jsp?regStatus=User Successfully Registered');
           },
           complete: function(response) 
           {
           },
           error: function(e)
           {
               console.log("sendRegistration(): " + e);
  
           }
  
       }; 
  
            $("#regForm").ajaxForm(options);
  </code></pre>
  
  <p>However now I get a 400 Bad Request which I take it to mean the my controller isn't even picking up the request.  Here's my controller code:</p>
  
  <pre><code>    @RequestMapping("/register.htm")
  public String register(//   @RequestParam("regProfilePic") File pic,
                          @RequestParam("regAccount_name") String account_name,
                          @RequestParam("pwd") String pwd,
                          @RequestParam("fname") String fname,
                          @RequestParam("lname") String lname,
  
                         ModelMap params){
  
      setup();
  
      System.out.println("Register");
      service.registerUser(fname, lname, account_name, pwd);
  
      return "MenuFrame";
  }
  </code></pre>
  
  <p>Here's My web.xml</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;Volt&lt;/display-name&gt;
  
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;Mugenjou.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
      &lt;session-config&gt;
        &lt;session-timeout&gt;30&lt;/session-timeout&gt; 
      &lt;/session-config&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/classes/beans.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt; 
      &lt;listener&gt;
          &lt;listener-class&gt;
              org.springframework.web.context.request.RequestContextListener
          &lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;volts&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
              org.springframework.web.servlet.DispatcherServlet
          &lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;volts&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;jsp-config&gt;
          &lt;taglib&gt;
              &lt;taglib-uri&gt;http://java.sun.com/jsp/jstl/core&lt;/taglib-uri&gt;
              &lt;taglib-location&gt;/WEB-INF/tld/c.tld&lt;/taglib-location&gt;
          &lt;/taglib&gt;
          &lt;taglib&gt;
              &lt;taglib-uri&gt;http://java.sun.com/jsp/jstl/fmt&lt;/taglib-uri&gt;
              &lt;taglib-location&gt;/WEB-INF/tld/fmt.tld&lt;/taglib-location&gt;
          &lt;/taglib&gt;
      &lt;/jsp-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>and here's my servlet</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
                             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                             http://www.springframework.org/schema/context
                             http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;context:component-scan base-package="com.mugenjou.control" /&gt;
  
      &lt;!--  /WEB-INF/jsp/VIEWNAME.jsp --&gt; 
      &lt;bean id="viewNameTranslator" class="org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator"/&gt;
      &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
         &lt;!-- &lt;property name="prefix" value="/WEB-INF/jsp/"/&gt; --&gt;
           &lt;property value="" name="prefix"/&gt; &lt;property value=".jsp" name="suffix"/&gt;
      &lt;/bean&gt;
  
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>the html</p>
  
  <pre><code>&lt;form id ='regForm' action="register.htm" method="POST" enctype="multipart/form-data"&gt;
  
                  &lt;table cellpadding=5&gt;
  
                      &lt;!-- &lt;tr&gt;
                          &lt;td&gt;Profile Picture &lt;br&gt; &lt;input type = "file" id ="regProfilePic" name ="regProfilePic"  /&gt;&lt;/td&gt;
                      &lt;/tr&gt; --&gt;
  
                      &lt;tr&gt;
                          &lt;td&gt; *Account Name &lt;br&gt; &lt;input id ="regAccount_name" name = "regAccount_name" type="text" size ="20" onblur="isAccount_name();registerBtn();"/&gt;&lt;/td&gt;
  
                          &lt;td&gt;
                              &lt;div id ="chkUserLb"&gt;&lt;/div&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
  
                      &lt;tr&gt;
                          &lt;td&gt; *Password &lt;br&gt; &lt;input id = "regPwd" name = "pwd" type="text" size ="20" onblur="isPwd();registerBtn();"/&gt;&lt;/td&gt;
                          &lt;td id=chkPwdLb&gt;&lt;/td&gt;
                      &lt;/tr&gt;
  
                      &lt;tr&gt;
                          &lt;td&gt; *First Name &lt;br&gt; &lt;input id = "regFname" name ="fname" type="text" size ="20" onblur="isFname();registerBtn();"/&gt;&lt;/td&gt;
                          &lt;td id=chkFnameLb&gt;&lt;/td&gt;
                      &lt;/tr&gt;
  
                      &lt;tr&gt;
                          &lt;td&gt; *Last Name &lt;br&gt; &lt;input id = "regLname" name = "lname" type="text" size ="20" onblur="isLname();registerBtn();"/&gt;&lt;/td&gt;
                          &lt;td id=chkLnameLb&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
  
                  &lt;tr&gt;
                      &lt;td&gt;&lt;input id = "regSubmitBtn" type="submit" value="Submit" disabled&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
              &lt;/table&gt;
  
              *Required
  
            &lt;/form&gt;
  </code></pre>