如何将 javascript return 值传递给 spring 路径变量

How to pass a javascript return value to spring path variable

我的目标是获取 javascript 函数的 return 值,然后作为 spring 路径变量传递

我尝试执行此代码:

我的问题是如何将 cust_id 作为参数传递? 如果有最简单的方法,请告诉我怎么做

我也遇到过类似的情况。我是这样实现的:

$('#cust').bind('change',function() {
    var custid = $(this).children("option:selected").val();
    alert("You have selected the Customer with id - " + custid);
    window.location = '/myAppURL?pareaName='+ $(this).val();
    });

这意味着从select(选项)中选择一个值我必须将它与更改事件绑定(我使用JQuery)。不确定它是否符合您的 "exact" 要求,但希望您能理解。