Spring DispatcherPortletを使用してxmlHttpRequestsを処理する経験をお持ちの方は、どうすればよいか教えてください。Spring-portlet POST ajax xmlHttpRequest
@ResourceMapping(value="stuff")
public void method(ResourceResponse response){
Person person = new Person();
person.setWeight(150);
ObjectMapper mapper = new ObjectMapper();
try{
mapper.writeValue(response.getWriter(), person);
}
...
}
アヤックス:
function() {
var A = AUI();
A.io("<portlet:resourceURL id="stuff" />", {
method: 'POST',
data: {
description: 'value'
}
});
}
Thisあなたは同じサポートを持っています春・ポートレット環境を投票することができます問題である私は、一例として、YUIのIOモジュールとジャクソンオブジェクトマッパーを使用していますそれは一般的なspring-mvcにあります。これは@ResponseBodyなどJSONへのデータ変換今、私の知る限り1は、それを手動で行う必要があります...です
EDITED:より良い https://stackoverflow.com/questions/4782971/handling-ajax-requests-with-spring-portlet を処方されるこの問題を見てみましょう:はPLEASEソリューションを考え出しました
http://stackoverflow.com/questions/4782971/handling-ajax-requests-with-spring-portletがもう存在しないように見える – Eric