İletim yöntemim çağrılıyor ancak Profilim boş. Bu yaklaşımın nesi yanlış? RestTemplate'i kullanmak için @Requestbody kullanmalı mıyım?RestTemplate yazısı varlık için
Profile profile = new Profile();
profile.setEmail(email);
String response = restTemplate.postForObject("http://localhost:8080/user/", profile, String.class);
@RequestMapping(value = "/", method = RequestMethod.POST)
public @ResponseBody
Object postUser(@Valid Profile profile, BindingResult bindingResult, HttpServletResponse response) {
//Profile is null
return profile;
}
Denetleyiciniz, 'RequestMapping' içindeki yolun 'kullanıcı' bölümünü içerecek şekilde açıklamalı mı? Senin metohd, ek denetleyici ek açıklamaları olmadan '/ user /' yanıtı vermeyecek olan, '/ 'işaret eder. –
@ nicholas.hauschild Evet. Denetleyici yöntemine giriyorum. Sorun, profilin gerçek yöntemde boş olmasıdır. – pethel