title: HTTP Status 400 – Bad Request
body: <p>Hi i am trying to select category while adding new category.Category details get from DB and I am trying to fetch it's PK to product <code>command</code> by using <code>&lt;form:select&gt;</code> tag.
  But it shows following error.</p>
  
  <h2>error</h2>
  
  <pre><code>HTTP Status 400 – Bad Request
  
  Type Status Report
  
  Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
  </code></pre>
  
  <h2>My Controller</h2>
  
  <pre><code>@RequestMapping(value="productlist/addproduct" , method=RequestMethod.POST)
      public String addProdt( @ModelAttribute ("prdt") Product p)
      {   
  
          pd.addProduct(p);
          MultipartFile prodImage=p.getImage();
          if(!prodImage.isEmpty()){
              Path paths=Paths.get("C:/Users/Dont open/Documents/Eclipse/ClickBuy/src/main/webapp/resources/Images/"+ p.getId()+".png");
              try
          {
              prodImage.transferTo(new File(paths.toString()));
          } catch (IllegalStateException e) 
          {
              e.printStackTrace();
          } catch (IOException e)
          {
              e.printStackTrace();
          }
          }
  
          return "redirect:/allProduct";
      } 
  </code></pre>
  
  <h2>Jsp</h2>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;%@ include file="header.jsp"%&gt;
      &lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  
  &lt;%@ page isELIgnored="false"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%&gt; 
  &lt;%@ page isELIgnored="false" %&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"&gt;
  &lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
    &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
    &lt;script&gt;
    $( function() {
      $( "#mfg" ).datepicker();
    } );
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;br&gt;
  &lt;h2 align="center"&gt;PRODUCT FORM&lt;/h2&gt;&lt;hr&gt;
  &lt;div class="col-md-2 "&gt;&lt;/div&gt;
  &lt;div align="center"&gt;&lt;div class="container"&gt;&lt;div class="col-md-8 "&gt;
  
  &lt;form:form method="POST" action="productlist/addproduct" commandName="prdt" enctype="multipart/form-data"&gt;
  &lt;table class="table table-hover"&gt;
  &lt;tr&gt;
  &lt;td&gt; &lt;form:label  path="product_Name"&gt; Enter Product Name&lt;/form:label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;form:input type="text" path="product_Name" class="form-control"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt; &lt;form:label path="descripction"&gt; Enter Product Descripction&lt;/form:label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;form:input type="text" path="descripction"  class="form-control"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt; &lt;form:label path="category"&gt; Enter Product Category&lt;/form:label&gt;&lt;/td&gt;
  &lt;td&gt;
  &lt;form:select path="category"&gt;
  &lt;c:forEach var="x" items="${catg}"&gt;
  &lt;form:option value="${x.category_id}" label="${x.category_name}" /&gt;&lt;/c:forEach&gt;
  &lt;/form:select&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt; &lt;form:label  path="price"&gt; Enter Product Price&lt;/form:label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;form:input type="text" path="price" placeholder=" Enter Product Price" class="form-control"/&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt; &lt;form:label  path="mfg_Date"&gt; Enter Manufacture Date&lt;/form:label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;form:input type="text" id="mfg" path="mfg_Date" class="form-control"/&gt;&lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt; &lt;label&gt; Choose Image&lt;/label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;form:input type="file" path="image" class="form-control"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;/table&gt;
   &lt;input type="submit" class="btn btn-primary btn-block" value="Add" class="form-control"/&gt;
  
  &lt;/form:form&gt;
  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks in advance!!</p>