If you use var
attribute of the url
tag it will put the value to the value stack.
<s:url action="action" method="method" var="methodUrl" />
<s:select name="actionAttribute" list="attributeList"
listKey="key" listValue="value"
onchange="ajaxFunction('%{#methodUrl}')" />
you can also use a function without parameter
<s:select name="actionAttribute" list="attributeList"
listKey="key" listValue="value"
onchange="ajaxFunction()" />
<script type="text/javascript">
function ajaxFunction(){
var methodUrl = '<s:property value="%{#methodUrl}"/>';
// or even better
var methodUrl2 = '<s:url action="action" method="method" var="methodUrl" />';
}
</script>
ok, if you want to push
a value into the value stack you should use this tag, but the value should be a reference to the object, that would convert to string url and passed as a parameter to JS function
<s:url action="action" method="method" var="methodUrl" />
<s:push value="%{#methodUrl}">
<s:select name="actionAttribute" list="attributeList"
listKey="key" listValue="value"
onchange="ajaxFunction('%{top}')" />
<script type="text/javascript">
function ajaxFunction(url){
alert(url);
}
</script>
</s:push>