私のブラウザでは、私のvオブジェクトの中に日付パラメータがあることがわかります(Wed Mar 25 2015 03:00:00 GMT + 0300(トルコ標準時) )、フルテキスト文字列形式。Spring Requestmappingでオブジェクトパラメータとして日付を投稿する方法
function saveVehicle(v) {
return $http.post('/shipment/vehicle/save', v).then(function(response) {
return response.data;
})
問題は、私のrequestmappingデバッグでは、dateパラメータにnullが含まれています。サーバー側のコーディングは、このようなものです:
@RequestMapping(value="/vehicle/save", method = RequestMethod.POST)
public Vehicle saveVehicle(@RequestBody Vehicle v){
return vehicleRepository.save(v);
}
そして、私の車のモデルは、このようなものです:
@Entity
@Table(name = "VEHICLE", schema = "VV")
public class Vehicle {
@Column(name = "LOADING_DT")
@JsonSerialize(using = TfJsonDateSerializer.class)
@JsonDeserialize(using = TfJsonDateDeSerializer.class)
private Date loadingDate;