【发布时间】:2015-02-23 13:07:20
【问题描述】:
我正在使用 Spring 2.5(基于 XML 的配置)。在我的 Spring 控制器中,如何将字符串返回给我的 AJAX 请求? 我的ajax代码如下:
jq("#editAdTextSave").click(function() {
alert( "Handler for .click() called." );
jq.ajax({
url: 'bookingDetail.html',
type: 'POST',
data: 'action=updateAdText',
success: function(data) {
//called when successful
alert(model);
//$('#ajaxphp-results').html(data);
},
error: function(e) {
//called when there is an error
//console.log(e.message);
}
});
});
CONtroller onSubmit 需要一个 ModelAndView 对象返回值。但是我只需要返回一个字符串。我该怎么做。请建议。
【问题讨论】:
标签: spring spring-mvc spring2.x spring-2.5