来自spring webflow的Ajax响应

时间:2013-09-04 09:49:20

标签: jquery ajax jsp spring-webflow

在ajax调用之后,我得到包含整个jsp页面的响应。如何只获取页面的一部分或当我使用SWF时如何才能获得仅来自evaluate块的结果? 我的js文件中有下一个ajax调用:

var url = $('#srcCurrencySpace').attr('resource');
    $.ajax({
        type : "POST",
        url : url,
        cache:false,
        data: $('#form').serialize(),
        dataType: "text",
        success : function(response)
        {
            //Write you success logic here
            var newHtml = $('#srcCurrencySpace', response).html();
            $('#srcCurrencySpace').html(newHtml);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) 
        {
            //Write you error-handling logic here
            alert("error!");
        }
      });  

此请求转到:

<transition on="updateAmountSrcCurrency"  validate="false">
            <evaluate expression="retrieverFactory.getSrcCurrency(application)" result="flowScope.amountSrcCurrency"/>
            <render fragments="srcCurrencySpace"></render>
</transition> 

最后我的jsp摘录:

<span id="srcCurrencySpace" resource="${updateURL}">
            <c:out value="${amountSrcCurrency}" default="LVL" />
</span> 

0 个答案:

没有答案