可以请任何有经验的人与Spring DispatcherPortlet处理后xmlHttpRequests,告诉我什么是最好的方式来做到这一点?我使用YUI IO模块和杰克逊对象映射器为例: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在这里你可以投票了春天的portlet环境将具有相同的支持问题那个普通的spring-mvc有。这@ResponseBody是,数据转换成JSON等,现在据我所知一个人做手工......
编辑:想出解决方案
请:看看这个问题,这是更好地制定https://stackoverflow.com/questions/4782971/handling-ajax-requests-with-spring-portlet
http://stackoverflow.com/questions/4782971/handling-ajax-requests-with-spring-portlet似乎不再存在 – Eric 2011-02-08 18:08:14