简体   繁体   English

HTTP状态400-客户端发送的请求在语法上不正确

[英]HTTP Status 400 - The request sent by the client was syntactically incorrect

There is some problem in it. 有一些问题。 as it gives Http status 400- The request sent by the client was syntactically incorrect. 因为它赋予Http状态400-客户端发送的请求在语法上不正确。 when i submit. 当我提交。 it doesnt reach to the controller. 它没有到达控制器。 Kindly review and help. 请检讨和帮助。

<c:url var="addr" value="/productsPage"/>
 <form:form method="POST" action="${addr}" modelAttribute="productsmodel"  enctype="multipart/form-data">

<form:input type="hidden" path="productId" value="" />
<form:input type="hidden" path="vendorDetails" value="" />
<form:input type="hidden" path="productDetail" value="" />

<tr><td>Product Name:--</td><td><form:input type="text" path="ProductName" value=""/></td></tr>
<tr><td>Product Description:--</td><td><form:input type="text" path="ProductDescription" value="" /></td></tr>
<tr><td>Category:--
</td><td><form:input type="text" path="Category" name="categorylist" list="listcategory" />
                            <datalist id="listcategory">
                            <option value="Add New">
                            <c:forEach items="${all_categories}" var="all_categories">
                            <option value="${all_categories.categoryName}">                         
                            </c:forEach>
                            </datalist>                     

</td></tr>
<tr><td>Quantity/Unit:--</td><td><form:input type="text" path="quantityPerUnit" value="" /></td></tr>
<tr><td>Unit Price:--</td><td><form:input type="text" path="unitPrice" value="" /></td></tr>
<tr><td>Size:--</td><td><form:radiobutton  path="size" value="1"/>L<form:radiobutton  path="size" value="2"/>M<form:radiobutton  path="size" value="3"/>S<form:radiobutton  path="size" value="0"/>NA</td></tr>
<tr><td>Color:--</td><td><form:input type="text" path="color" value=""/></td></tr>
<tr><td>Discount:--</td><td><form:input type="text" path="discount" value=""/></td></tr>
<tr><td>Weight/Unit:--</td><td><form:input type="text" path="weight" value=""/></td></tr>
<tr><td>Units on Order:--</td><td><form:input type="text" path="unitsOnOrder" value=""/></td></tr>
<tr><td>Picture:--</td><td><input type="file" name="pictureLink" size="100" /></td></tr>

<tr><td></td><td><input type="submit" value="Save"/></td></tr>

</form:form>

</table>

Controller 调节器

{ {

@RequestMapping(value={"/productsPage"},method=RequestMethod.POST)  
public String ProductPost(@ModelAttribute("productsmodel") Products products, Model model,@RequestParam("picture") MultipartFile file1){


    System.out.println("In Post Products");

    return "products";
    }

} }

Model { 型号{

@Entity
@Table(name="Products")
public class Products
{
  @Id
  @GeneratedValue
  @Column(name="ProductId")
    private Integer productId;

  @Column(name="productName")
  private String ProductName;

  @Column(name="productDescription")
  private String ProductDescription;

  @ManyToOne
  @JoinColumn(name="category")
  private Categories category;

  @Column(name="quantityPerUnit")
  private int quantityPerUnit;

  @Column(name="unitPrice")
  private BigDecimal unitPrice;

  @Column(name="size")
  private int size;

  @Column(name="color")
  private String color;

  @Column(name="discount")
  private BigDecimal discount;

  @Column(name="weight")
  private double weight;

  @Column(name="unitsOnOrder")
  private int unitsOnOrder;

  @ManyToOne
  @JoinColumn(name="vendorDetailsId")
  private Vendor vendorDetails;

  @OneToOne
  @JoinColumn(name="ProductExtraDetails")
  private ProductExtraDetails productDetail;

} }

Thank you. 谢谢。 I figure it out. 我知道了。

Category, productDetail and vendordetails are joined to other table, and have to add their ID's. 类别,productDetail和vendordetails已联接到其他表,并且必须添加其ID。 ie productDetail.productID as path 即productDetail.productID作为路径

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 状态400客户端发送的请求在语法上不正确。 AngularJS http - Status 400 The request sent by the client was syntactically incorrect. Angularjs http HTTP状态400在春季,客户端发送的请求在语法上不正确 - HTTP Status 400 The request sent by the client was syntactically incorrect in Spring Spring RestController-HTTP状态400客户端发送的请求在语法上不正确 - Spring RestController - HTTP Status 400 The request sent by the client was syntactically incorrect HTTP状态400-客户端发送的请求在语法上与spring不正确 - HTTP Status 400 - The request sent by the client was syntactically incorrect with spring HTTP状态400-客户端发送的请求在语法上不正确。 -在使用Hibernate的Spring MVC Web应用程序中 - HTTP Status 400 - The request sent by the client was syntactically incorrect. - within a Spring MVC web app using Hibernate 错误 HTTP 状态 400 - 客户端发送的请求在语法上不正确。 更新 - error HTTP Status 400 -The request sent by the client was syntactically incorrect. updated Http状态400-客户端发送的请求在语法上不正确。 春季MVC - Http status 400 -The request sent by the client was syntactically incorrect. Spring MVC Spring Mvc表单发布HTTP状态400客户端发送的请求在语法上不正确 - Spring Mvc Form Post HTTP Status 400 The request sent by the client was syntactically incorrect Spring MVC-将值从jsp传递到控制器-HTTP状态400-客户端发送的请求在语法上不正确 - Spring MVC - Passing Value from jsp to Controller - HTTP Status 400 - The request sent by the client was syntactically incorrect 春季HTTP错误400客户端发送的请求在语法上不正确 - spring http error 400 The request sent by the client was syntactically incorrect
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM