app.Model.BrandModel = Backbone.Model.extend({
idAttribute: 'brandId',
defaults: {
name : '',
description : '',
brandImage : '',
user : '',
showPro : false,
proDescription : ''
},
url : function(){
return '/rest/brands/' + brandId;
}
});
방화벽 서버에서 내 서버가 다음 JSON 응답을 반환하고 있습니다. 요청이 성공했습니다.백본 모델이 채워지지 않습니다.
brandId "fc692c70-4096-11e3-a0f2-3c970e02b4ec"
name "Galeria"
user "940ee800-4090-11e3-80c0-3c970e02b4ec"
description "This is galeria"
brandImage "/brand-images/fc692c70-...3-a0f2-3c970e02b4ec.jpg"
proDescription ""
showPro false
나는 이렇게 부르고있다.
var brandModel = new app.Model.BrandModel();
brandModel.fetch();
그러나 내 모델이 채워지지 않고 값은 여전히 기본 값입니다.
내 컨트롤러
@RequestMapping(value = "/rest/brands/{brandId}",
method = RequestMethod.GET,
produces = "application/json")
@ResponseBody
public Brand getBrand(@PathVariable("brandId") String brandId, HttpServletResponse response) {